Print this page
12288 getfacl and setfacl could stand improvement


   5 NAME
   6        setfacl - modify the Access Control List (ACL) for a file or files
   7 
   8 SYNOPSIS
   9        setfacl [-r] -s acl_entries file
  10 
  11 
  12        setfacl [-r] -md acl_entries file
  13 
  14 
  15        setfacl [-r] -f acl_file file
  16 
  17 
  18 DESCRIPTION
  19        For each file specified, setfacl either replaces its entire ACL,
  20        including the default ACL on a directory, or it adds, modifies, or
  21        deletes one or more ACL entries, including default entries on
  22        directories.
  23 
  24 






  25        When the setfacl command is used, it can result in changes to the file
  26        permission bits. When the user ACL entry for the file owner is changed,
  27        the file owner class permission bits are modified. When the group ACL
  28        entry for the file group class is changed, the file group class
  29        permission bits are modified. When the other ACL entry is changed, the
  30        file other class permission bits are modified.
  31 
  32 
  33        If you use the chmod(1) command to change the file group owner
  34        permissions on a file with ACL entries, both the file group owner
  35        permissions and the ACL mask are changed to the new permissions. Be
  36        aware that the new ACL mask permissions can change the effective
  37        permissions for additional users and groups who have ACL entries on the
  38        file.
  39 
  40 
  41        A directory can contain default ACL entries. If a file or directory is
  42        created in a directory that contains default ACL entries, the newly
  43        created file has permissions generated according to the intersection of
  44        the default ACL entries and the permissions requested at creation time.


 265 
 266 
 267        The following example sets the same ACL on file abc as the file xyz.
 268 
 269 
 270          getfacl xyz | setfacl -f - abc
 271 
 272 
 273 
 274 FILES
 275        /etc/passwd
 276                       password file
 277 
 278 
 279        /etc/group
 280                       group file
 281 
 282 
 283 SEE ALSO
 284        chmod(1), getfacl(1), umask(1), aclcheck(3SEC), aclsort(3SEC),
 285        group(4), passwd(4), attributes(5)
 286 
 287 
 288 
 289                                December 19, 2006                    SETFACL(1)


   5 NAME
   6        setfacl - modify the Access Control List (ACL) for a file or files
   7 
   8 SYNOPSIS
   9        setfacl [-r] -s acl_entries file
  10 
  11 
  12        setfacl [-r] -md acl_entries file
  13 
  14 
  15        setfacl [-r] -f acl_file file
  16 
  17 
  18 DESCRIPTION
  19        For each file specified, setfacl either replaces its entire ACL,
  20        including the default ACL on a directory, or it adds, modifies, or
  21        deletes one or more ACL entries, including default entries on
  22        directories.
  23 
  24 
  25        The setfacl utility can only manipulate POSIX-draft ACLs.  See acl(5)
  26        for a description of the difference between the older POSIX-draft ACLs
  27        and the newer NFSv4 ACLs.  The chmod(1) utility can be used to
  28        manipulate ACLs on all types of file system.
  29 
  30 
  31        When the setfacl command is used, it can result in changes to the file
  32        permission bits. When the user ACL entry for the file owner is changed,
  33        the file owner class permission bits are modified. When the group ACL
  34        entry for the file group class is changed, the file group class
  35        permission bits are modified. When the other ACL entry is changed, the
  36        file other class permission bits are modified.
  37 
  38 
  39        If you use the chmod(1) command to change the file group owner
  40        permissions on a file with ACL entries, both the file group owner
  41        permissions and the ACL mask are changed to the new permissions. Be
  42        aware that the new ACL mask permissions can change the effective
  43        permissions for additional users and groups who have ACL entries on the
  44        file.
  45 
  46 
  47        A directory can contain default ACL entries. If a file or directory is
  48        created in a directory that contains default ACL entries, the newly
  49        created file has permissions generated according to the intersection of
  50        the default ACL entries and the permissions requested at creation time.


 271 
 272 
 273        The following example sets the same ACL on file abc as the file xyz.
 274 
 275 
 276          getfacl xyz | setfacl -f - abc
 277 
 278 
 279 
 280 FILES
 281        /etc/passwd
 282                       password file
 283 
 284 
 285        /etc/group
 286                       group file
 287 
 288 
 289 SEE ALSO
 290        chmod(1), getfacl(1), umask(1), aclcheck(3SEC), aclsort(3SEC),
 291        group(4), passwd(4), acl(5), attributes(5)
 292 
 293 
 294 
 295                                February 8, 2020                     SETFACL(1)