Print this page
12288 getfacl and setfacl could stand improvement

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man5/acl.5.man.txt
          +++ new/usr/src/man/man5/acl.5.man.txt
   1    1  ACL(5)                Standards, Environments, and Macros               ACL(5)
   2    2  
   3    3  
   4    4  
   5    5  NAME
   6    6         acl - Access Control Lists
   7    7  
   8    8  DESCRIPTION
   9    9         Access control lists (ACLs) are discretionary access control mechanisms
  10   10         that grant and deny access to files and directories. Two different ACL
  11      -       models are supported in the Solaris release: POSIX-draft ACLs and NFSv4
  12      -       ACLs.
       11 +       models are supported in this release: POSIX-draft ACLs and NFSv4 ACLs.
  13   12  
  14   13  
  15   14         The older, POSIX-draft model is supported by the UFS file system. This
  16   15         model is based on a withdrawn ACL POSIX specification that was never
  17   16         standardized. It was subsequently withdrawn by the POSIX committee.
  18   17  
  19   18  
  20   19         The other model is based on the standards of the NFSv4 working group
  21   20         and is an approved standard from the Internet Engineering Task Force
  22   21         (IETF). The ZFS file system uses the NFSv4 model, and provides richer
  23   22         semantics and finer grained permission capabilities than the POSIX-
  24   23         draft model.
  25   24  
  26   25     POSIX-draft ACLs
  27   26         POSIX-draft ACLs provide an alternative security mechanism to basic
  28      -       UNIX file permissions in the Solaris release. Their purpose is to
  29      -       further restrict access to files and directories or to extend
  30      -       permissions to a particular user. ACLs can be used to change the
  31      -       permissions for the standard owner, group and other class bits of a
  32      -       file's mode. ACLs can give additional users and groups access to the
  33      -       file. A directory can also have a special kind of ACL called a default
  34      -       ACL, which defines ACL entries to be inherited by descendents of the
  35      -       directory. POSIX-draft ACLs have an ACL entry called mask. The mask
  36      -       defines the maximum permissions that can be granted to additional user
  37      -       and group entries. Whenever a file is created or its mode is changed by
  38      -       chmod(1) or chmod(2), the mask is recomputed. It is recomputed to be
  39      -       the group permission defined in the mode passed to chmod(2).
       27 +       UNIX file permissions. Their purpose is to further restrict access to
       28 +       files and directories or to extend permissions to a particular user.
       29 +       ACLs can be used to change the permissions for the standard owner,
       30 +       group and other class bits of a file's mode. ACLs can give additional
       31 +       users and groups access to the file. A directory can also have a
       32 +       special kind of ACL called a default ACL, which defines ACL entries to
       33 +       be inherited by descendents of the directory. POSIX-draft ACLs have an
       34 +       ACL entry called mask. The mask defines the maximum permissions that
       35 +       can be granted to additional user and group entries. Whenever a file is
       36 +       created or its mode is changed by chmod(1) or chmod(2), the mask is
       37 +       recomputed. It is recomputed to be the group permission defined in the
       38 +       mode passed to chmod(2).
  40   39  
  41   40  
  42   41         The POSIX-draft ACL model uses the standard rwx model of traditional
  43   42         UNIX permissions.
  44   43  
  45   44  
  46   45         An ACL is represented as follows:
  47   46  
  48   47           acl_entry[,acl_entry]...
  49   48  
↓ open down ↓ 21 lines elided ↑ open up ↑
  71   70  
  72   71  
  73   72         For example to give user joe read and write permissions, the ACL entry
  74   73         is specified as:
  75   74  
  76   75           user:joe:rw-
  77   76  
  78   77  
  79   78  
  80   79     NFSv4 ACLs
  81      -       NFSv4 ACL model is based loosely on the Windows NT ACL model. NFSv4
       80 +       The NFSv4 ACL model is based loosely on the Windows NT ACL model. NFSv4
  82   81         ACLs provide a much richer ACL model than POSIX-draft ACLs.
  83   82  
  84   83  
  85   84         The major differences between NFSv4 and POSIX-draft ACLs are as
  86   85         follows:
  87   86  
  88   87             o      NFSv4 ACLs provide finer grained permissions than the rwx
  89   88                    model.
  90   89  
  91   90             o      NFSv4 ACLs allow for both ALLOW and DENY entries.
↓ open down ↓ 4 lines elided ↑ open up ↑
  96   95  
  97   96                 o      Whether inheritance cascades to both files and
  98   97                        directories or only to files or directories.
  99   98  
 100   99                 o      In the case of directories, you can indicate whether
 101  100                        inheritance is applied to the directory itself, to just
 102  101                        one level of subdirectories, or cascades to all
 103  102                        subdirectories of the directory.
 104  103  
 105  104             o      NFSv4 ACLs provide a mechanism for hooking into a system's
 106      -                  audit trail.  Currently, Solaris does not support this
      105 +                  audit trail.  Currently, illumos does not support this
 107  106                    mechanism.
 108  107  
 109  108             o      NFSv4 ACLs enable administrators to specify the order in
 110  109                    which ACL entries are checked. With POSIX-draft ACLs the
 111  110                    file system reorders ACL entries into a well defined, strict
 112  111                    access, checking order.
 113  112  
 114  113  
 115  114         POSIX-draft ACL semantics can be achieved with NFSv4 ACLs. However,
 116  115         only some NFSv4 ACLs can be translated to equivalent POSIX-draft ACLs.
↓ open down ↓ 218 lines elided ↑ open up ↑
 335  334  
 336  335  
 337  336         The inheritance flags can also be specified in a more compact manner,
 338  337         as follows:
 339  338  
 340  339           user:fred:rwR:f:allow
 341  340           user:fred:rwR:f------:allow
 342  341  
 343  342  
 344  343  
 345      -   Shell-level Solaris API
 346      -       The Solaris command interface supports the manipulation of ACLs. The
 347      -       following Solaris utilities accommodate both ACL models:
      344 +   Shell-level API
      345 +       Several utilities support the manipulation of ACLs. The following
      346 +       utilities accommodate both ACL models:
 348  347  
 349  348         chmod
 350  349                     The chmod utility has been enhanced to allow for the
 351  350                     setting and deleting of ACLs. This is achieved by extending
 352  351                     the symbolic-mode argument to support ACL manipulation. See
 353  352                     chmod(1) for details.
 354  353  
 355  354  
 356  355         compress
 357  356                     When a file is compressed any ACL associated with the
↓ open down ↓ 44 lines elided ↑ open up ↑
 402  401  
 403  402  
 404  403         unpack
 405  404                     When a file with an ACL is unpacked, the unpacked file
 406  405                     retains the ACL information.
 407  406  
 408  407  
 409  408     Application-level API
 410  409         The primary interfaces required to access file system ACLs at the
 411  410         programmatic level are the acl_get() and acl_set() functions. These
 412      -       functions support both POSIX draft ACLs and NFSv4 ACLs.
      411 +       functions support both POSIX-draft ACLs and NFSv4 ACLs.
 413  412  
 414  413     Retrieving a file's ACL
 415  414           int acl_get(const char *path, int flag, acl_t **aclp);
 416  415           int facl_get(int fd, int flag, acl_t **aclp);
 417  416  
 418  417  
 419  418  
 420      -       The acl_get(3SEC) and facl_get(3SEC) functions retrieves an ACL on a
      419 +       The acl_get(3SEC) and facl_get(3SEC) functions retrieve an ACL on a
 421  420         file whose name is given by path or referenced by the open file
 422  421         descriptor fd. The flag argument specifies whether a trivial ACL should
 423      -       be retrieved. When the flag argument equals ACL_NO_TRIVIAL then only
 424      -       ACLs that are not trivial are retrieved. The ACL is returned in the
 425      -       aclp argument.
      422 +       be retrieved. When the flag argument equals ACL_NO_TRIVIAL only ACLs
      423 +       that are not trivial are retrieved. The ACL is returned in the aclp
      424 +       argument.
 426  425  
 427  426     Freeing ACL structure
 428      -         void acl_free(acl_t *aclp)s;
      427 +         void acl_free(acl_t *aclp);
 429  428  
 430  429  
 431  430  
 432  431         The acl_free() function frees up memory allocated for the argument
 433      -       aclp;.
      432 +       aclp.
 434  433  
 435  434     Setting an ACL on a file
 436  435           int acl_set(const char *path, acl_t *aclp);
 437  436           int facl_set(int fd, acl_t *aclp);
 438  437  
 439  438  
 440  439  
 441  440         The acl_set(3SEC) and facl_get(3SEC) functions are used for setting an
 442  441         ACL on a file whose name is given by path or referenced by the open
 443  442         file descriptor fd. The aclp argument specifies the ACL to set. The
 444      -       acl_set(3SEC) translates an POSIX-draft ACL into a NFSv4 ACL when the
 445      -       target file systems supports NFSv4 ACLs. No translation is performed
 446      -       when trying to set an NFSv4 ACL on a POSIX-draft ACL supported file
 447      -       system.
      443 +       acl_set(3SEC) function translates a POSIX-draft ACL into a NFSv4 ACL
      444 +       when the target file system supports NFSv4 ACLs. No translation is
      445 +       performed when trying to set an NFSv4 ACL on a POSIX-draft ACL
      446 +       supported file system.
 448  447  
 449  448     Determining an ACL's trivialness
 450  449           int acl_trivial(const char *path);
 451  450  
 452  451  
 453  452  
 454  453         The acl_trivial() function is used to determine whether a file has a
 455  454         trivial ACL.
 456  455  
 457  456     Removing all ACLs from a file
↓ open down ↓ 10 lines elided ↑ open up ↑
 468  467           int acl_fromtext(const char *path, acl_t **aclp);
 469  468           char *acl_totext(acl_t *aclp, int flags);
 470  469  
 471  470  
 472  471  
 473  472         The acl_totext() function converts an internal ACL representation
 474  473         pointed to by aclp into an external representation. See DESCRIPTION for
 475  474         details about external representation.
 476  475  
 477  476  
 478      -       The acl_fromtext() functions converts and external representation into
 479      -       an internal representation. See DESCRIPTION for details about external
      477 +       The acl_fromtext() function converts an external representation into an
      478 +       internal representation. See DESCRIPTION for details about external
 480  479         representation.
 481  480  
 482  481  EXAMPLES
 483  482         The following examples demonstrate how the API can be used to perform
 484  483         basic operations on ACLs.
 485  484  
 486  485         Example 1 Retrieving and Setting an ACL
 487  486  
 488  487  
 489  488         Use the following to retrieve an ACL and set it on another file:
↓ open down ↓ 51 lines elided ↑ open up ↑
 541  540  
 542  541  
 543  542  SEE ALSO
 544  543         chgrp(1), chmod(1), chown(1), cp(1), cpio(1), find(1), ls(1), mv(1),
 545  544         tar(1), setfacl(1), chmod(2), acl(2), stat(2), acl_get(3SEC),
 546  545         aclsort(3SEC), acl_fromtext(3SEC), acl_free(3SEC), acl_strip(3SEC),
 547  546         acl_trivial(3SEC)
 548  547  
 549  548  
 550  549  
 551      -                               November 24, 2014                        ACL(5)
      550 +                               February 8, 2020                         ACL(5)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX