Valore predefinito della maschera ACL

3

Questa è la domanda che ho affrontato in un'intervista come amministratore di sistema.

If we didn't set the mask value, what is the default value of mask?

Stavo pensando che se non avessimo impostato la maschera, dovrebbe essere rwx , giusto?

Ad esempio:

> touch testfile
> getfacl testfile
# file: testfile
# owner: chenicha
# group: csgrad
user::rw-
group::r--
other::r--

Anche se non ha indicato lo stato della maschera, ma presumo che dovrebbe essere rwx , giusto?

    
posta Coda Chang 13.10.2018 - 22:03
fonte

1 risposta

0

Se non applichi alcun tipo di ACL , non sarà necessario un mask . Secondo questo ,

The mask entry is automatically created when needed but not provided.

E secondo questo se usi il ACL minimo, non verrà aggiunta alcuna maschera.

 [arif@arif blabla]$ ls -ldha .
 drwxrwxr-x. 2 arif arif 4.0K Oct 17 06:13 .
 [arif@arif blabla]$ getfacl --omit-header .
 user::rwx
 group::rwx
 other::r-x

[arif@arif blabla]$ chmod g-wx .
[arif@arif blabla]$ getfacl --omit-header .
user::rwx
group::r--
other::r-x

[arif@arif blabla]$ setfacl -m g::rw .
[arif@arif blabla]$ getfacl --omit-header .
user::rwx
group::rw-
other::r--

Secondo questo ,

Extended ACLs also contain a mask entry and may contain any number of named user and named group entries.

Quindi ora useremo ACL esteso che risulta group class autorizzazioni mappate alla voce mask perché come menzionato qui ,

In minimal ACLs, the group class permissions are identical to the owning group permissions. In extended ACLs, the group class may contain entries for additional users or groups. This results in a problem: some of these additional entries may contain permissions that are not contained in the owning group entry, so the owning group entry permissions may differ from the group class permissions.

This problem is solved by the virtue of the mask entry. With minimal ACLs, the group class permissions map to the owning group entry permissions. With extended ACLs, the group class permissions map to the mask entry permissions, whereas the owning group entry still defines the owning group permissions.

[arif@arif blabla]$ setfacl -m g:wheel:rw .
[arif@arif blabla]$ getfacl --omit-header .
user::rwx
group::rw-
group:wheel:rw-
mask::rw-
other::r--

Qui puoi vedere che il valore dell'autorizzazione della classe del gruppo è mappato a mask nonostante la definizione di uno specifico mask . E questo approccio di mappatura garantisce l'interazione regolare delle applicazioni, indipendentemente dal fatto che abbiano il supporto ACL. Il motivo dell'utilizzo di group class permission bit come mask è descritto nel Documentazione TRUSIX come segue,

The file group class permission bits are the preferred masking field, even though they encourage permissive default access by the owning group. This choice must be made because the use of the file owner class would cause compatibility problems in programs which attempt to establish "owner-only" access, whereas the designation of the file other class could leave objects open to attack were an ACL removed or never present. An additional option of masking user entries with the file owner class permission bits and group entries with the file group class permission bits has the same disadvantages as masking against only the file owner class.

Quindi, credo che avresti potuto dire che il valore predefinito di mask è uguale al valore di autorizzazione group class .

    
risposta data 17.10.2018 - 13:46
fonte

Leggi altre domande sui tag