getfacl の「flags」フィールドはどういう意味ですか?

getfacl の「flags」フィールドはどういう意味ですか?

ACL を使用して、サーバー上のユーザー間の権限を設定しようとしています。 を使用してディレクトリの 1 つでステータスを確認するとgetfacl dir10、次のように表示されます。

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

これらのフラグは何を意味しますか? どうすれば変更できますか?

答え1

から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.)

これらの値を設定するには、次を参照してください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'.

答え2

@umläute フラグの意味については完全に正しいです。ただし、フラグを削除するには、権限-s-からフラグを削除する必要がありますUNIX

つまり

chmod g-s ./dir10

権限を以前のレベルに戻すだけ--restore=fileです (setgid が削除される場合もあれば、削除されない場合もあります)。また、ディレクトリでは機能せず、ファイルのみに機能すると思います。

関連情報