Was bedeutet das Feld „flags“ in getfacl?

Was bedeutet das Feld „flags“ in getfacl?

Ich versuche, mithilfe von ACLs Berechtigungen auf einem Server zwischen Benutzern festzulegen. Wenn ich ihren Status in einem der Verzeichnisse mithilfe von überprüfe getfacl dir10, wird Folgendes angezeigt:

root@svn:/srv/resources/somedir# getfacl dir10
# file: dir10
# owner: root
# group: mygroup
# flags: -s-

Was bedeuten diese Flags? Wie kann ich sie ändern?

Antwort1

aus man getfacl:

 The output format of getfacl is as follows:
               1:  # file: somedir/
               2:  # owner: lisa
               3:  # group: staff
               4:  # flags: -s-
 [...]
 Line  4  indicates the setuid (s), setgid (s), and sticky (t) bits:
          either the letter representing the bit, or else a dash (-).
          This line is included if any of those bits is set and left out
          otherwise, so it will not be shown for most files. (See
          CONFORMANCE TO POSIX 1003.1e DRAFT STANDARD 17 below.)

Um diese Werte einzustellen, siehe man setfacl:

   --restore=file
       Restore a permission backup created by `getfacl -R' or similar.
       All permissions of a complete directory subtree are restored using
       this  mechanism.  If the input contains owner comments or group
       comments, setfacl attempts to restore the owner and owning group. If
       the input contains flags comments (which define the setuid, setgid,
       and sticky bits), setfacl sets those three bits accordingly;
       otherwise, it clears them. This  option  cannot  be  mixed  with
       other options except `--test'.

Antwort2

@umläute hat völlig recht mit der Bedeutung des Flags. Um es jedoch loszuwerden, -s-müssen Sie es aus den UNIXBerechtigungen entfernen.

Dh

chmod g-s ./dir10

Dadurch --restore=filewerden die Berechtigungen lediglich auf eine vorherige Ebene zurückgesetzt (wodurch die Setgid entfernt werden kann, vielleicht aber auch nicht). Und ich glaube nicht, dass dies bei Verzeichnissen funktioniert, sondern nur bei Dateien.

verwandte Informationen