Print this page
12288 getfacl and setfacl could stand improvement

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/setfacl.1
          +++ new/usr/src/man/man1/setfacl.1
   1    1  '\" te
   2    2  .\"  Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
        3 +.\" Copyright (c) 2020 Peter Tribble.
   3    4  .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4    5  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5    6  .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6      -.TH SETFACL 1 "Dec 19, 2006"
        7 +.TH SETFACL 1 "Feb 8, 2020"
   7    8  .SH NAME
   8    9  setfacl \- modify the Access Control List (ACL) for a file or files
   9   10  .SH SYNOPSIS
  10      -.LP
  11   11  .nf
  12   12  \fBsetfacl\fR [\fB-r\fR] \fB-s\fR \fIacl_entries\fR \fIfile\fR
  13   13  .fi
  14   14  
  15   15  .LP
  16   16  .nf
  17   17  \fBsetfacl\fR [\fB-r\fR] \fB-md\fR \fIacl_entries\fR \fIfile\fR
  18   18  .fi
  19   19  
  20   20  .LP
  21   21  .nf
  22   22  \fBsetfacl\fR [\fB-r\fR] \fB-f\fR \fIacl_file\fR \fIfile\fR
  23   23  .fi
  24   24  
  25   25  .SH DESCRIPTION
  26      -.sp
  27      -.LP
  28   26  For each file specified, \fBsetfacl\fR either replaces its entire \fBACL\fR,
  29   27  including the default \fBACL\fR on a directory, or it adds, modifies, or
  30   28  deletes one or more \fBACL\fR entries, including default entries on
  31   29  directories.
  32   30  .sp
  33   31  .LP
       32 +The \fBsetfacl\fR utility can only manipulate POSIX-draft \fBACL\fRs.  See
       33 +\fBacl\fR(5) for a description of the difference between the older POSIX-draft
       34 +\fBACL\fRs and the newer NFSv4 \fBACL\fRs.  The \fBchmod\fR(1) utility can
       35 +be used to manipulate \fBACL\fRs on all types of file system.
       36 +.sp
       37 +.LP
  34   38  When the \fBsetfacl\fR command is used, it can result in changes to the file
  35   39  permission bits. When the user \fBACL\fR entry for the file owner is changed,
  36   40  the file owner class permission bits are modified. When the group \fBACL\fR
  37   41  entry for the file group class is changed, the file group class permission bits
  38   42  are modified. When the other \fBACL\fR entry is changed, the file other class
  39   43  permission bits are modified.
  40   44  .sp
  41   45  .LP
  42   46  If you use the \fBchmod\fR(1) command to change the file group owner
  43   47  permissions on a file with \fBACL\fR entries, both the file group owner
↓ open down ↓ 12 lines elided ↑ open up ↑
  56   60  initialized according to the intersection described above. The default
  57   61  \fBACL\fR should be thought of as the maximum discretionary access permissions
  58   62  that can be granted.
  59   63  .sp
  60   64  .LP
  61   65  Use the \fBsetfacl\fR command to set ACLs on files in a UFS file system, which
  62   66  supports POSIX-draft ACLS (or \fBaclent_t\fR style ACLs). Use the \fBchmod\fR
  63   67  command to set ACLs on files in a ZFS file system, which supports NFSv4-style
  64   68  ACLS (or \fBace_t\fR style ACLs).
  65   69  .SS "\fIacl_entries\fR Syntax"
  66      -.sp
  67      -.LP
  68   70  For the \fB-m\fR and \fB-s\fR options, \fIacl_entries\fR are one or more
  69   71  comma-separated \fBACL\fR entries.
  70   72  .sp
  71   73  .LP
  72   74  An \fBACL\fR entry consists of the following fields separated by colons:
  73   75  .sp
  74   76  .ne 2
  75   77  .na
  76   78  \fB\fIentry_type\fR\fR
  77   79  .ad
↓ open down ↓ 29 lines elided ↑ open up ↑
 107  109  The following table shows the valid \fBACL\fR entries (default entries can only
 108  110  be specified for directories):
 109  111  .sp
 110  112  
 111  113  .sp
 112  114  .TS
 113  115  c c
 114  116  l l .
 115  117  \fBACL\fR Entry Description
 116  118  _
 117      -u[ser]::\fIperms\fR     File owner permissions.
 118      -g[roup]::\fIperms\fR    File group owner permissions.
 119      -o[ther]:\fIperms\fR     T{
      119 +u[ser]::\fIperms\fR     File owner permissions.
      120 +g[roup]::\fIperms\fR    File group owner permissions.
      121 +o[ther]:\fIperms\fR     T{
 120  122  Permissions for users other than the file owner or members of file group owner.
 121  123  T}
 122      -m[ask]:\fIperms\fR      T{
      124 +m[ask]:\fIperms\fR      T{
 123  125  The \fBACL\fR mask. The mask entry indicates the maximum permissions allowed for users (other than the owner) and for groups. The mask is a quick way to change permissions on all the users and groups.
 124  126  T}
 125  127  u[ser]:\fIuid:perms\fR  T{
 126  128  Permissions for a specific user. For \fIuid\fR, you can specify either a user name or a numeric UID.
 127  129  T}
 128  130  g[roup]:\fIgid:perms\fR T{
 129  131  Permissions for a specific group. For \fIgid\fR, you can specify either a group name or a numeric GID.
 130  132  T}
 131      -d[efault]:u[ser]::\fIperms\fR   Default file owner permissions.
 132      -d[efault]:g[roup]::\fIperms\fR  Default file group owner permissions.
 133      -d[efault]:o[ther]:\fIperms\fR   T{
      133 +d[efault]:u[ser]::\fIperms\fR   Default file owner permissions.
      134 +d[efault]:g[roup]::\fIperms\fR  Default file group owner permissions.
      135 +d[efault]:o[ther]:\fIperms\fR   T{
 134  136  Default permissions for users other than the file owner or members of the file group owner.
 135  137  T}
 136      -d[efault]:m[ask]:\fIperms\fR    Default \fBACL\fR mask.
      138 +d[efault]:m[ask]:\fIperms\fR    Default \fBACL\fR mask.
 137  139  d[efault]:u[ser]:\fIuid\fR:\fIperms\fR  T{
 138  140  Default permissions for a specific user. For \fIuid\fR, you can specify either a user name or a numeric UID.
 139  141  T}
 140  142  d[efault]:g[roup]:\fIgid\fR:\fIperms\fR T{
 141  143  Default permissions for a specific group. For \fIgid\fR, you can specify either a group name or a numeric GID.
 142  144  T}
 143  145  .TE
 144  146  
 145  147  .sp
 146  148  .LP
 147  149  For the \fB-d\fR option, \fIacl_entries\fR are one or more comma-separated
 148  150  \fBACL\fR entries without permissions. Notice that the entries for file owner,
 149  151  file group owner, \fBACL\fR mask, and others can not be deleted.
 150  152  .SH OPTIONS
 151      -.sp
 152      -.LP
 153  153  The options have the following meaning:
 154  154  .sp
 155  155  .ne 2
 156  156  .na
 157  157  \fB\fB-d\fR \fIacl_entries\fR\fR
 158  158  .ad
 159  159  .RS 18n
 160  160  Deletes one or more entries from the file. The entries for the file owner, the
 161  161  file group owner, and others can not be deleted from the \fBACL\fR. Notice that
 162  162  deleting an entry does not necessarily have the same effect as removing all
↓ open down ↓ 123 lines elided ↑ open up ↑
 286  286  .el o
 287  287  Exactly one \fBdefault other\fR entry.
 288  288  .RE
 289  289  There can be additional \fBdefault user\fR entries and additional \fBdefault
 290  290  group\fR entries specified, but there can not be duplicate additional
 291  291  \fBdefault user\fR entries with the same \fIuid\fR, or duplicate \fBdefault
 292  292  group\fR entries with the same \fIgid\fR.
 293  293  .RE
 294  294  
 295  295  .SH EXAMPLES
 296      -.LP
 297  296  \fBExample 1 \fRAdding read permission only
 298  297  .sp
 299  298  .LP
 300  299  The following example adds one \fBACL\fR entry to file \fBabc\fR, which gives
 301  300  user \fBshea\fR read permission only.
 302  301  
 303  302  .sp
 304  303  .in +2
 305  304  .nf
 306  305  \fBsetfacl -m user:shea:r\(mi\(mi abc\fR
↓ open down ↓ 39 lines elided ↑ open up ↑
 346  345  
 347  346  .sp
 348  347  .in +2
 349  348  .nf
 350  349  \fBgetfacl xyz | setfacl -f \(mi abc\fR
 351  350  .fi
 352  351  .in -2
 353  352  .sp
 354  353  
 355  354  .SH FILES
 356      -.sp
 357  355  .ne 2
 358  356  .na
 359  357  \fB\fB/etc/passwd\fR\fR
 360  358  .ad
 361  359  .RS 15n
 362  360  password file
 363  361  .RE
 364  362  
 365  363  .sp
 366  364  .ne 2
 367  365  .na
 368  366  \fB\fB/etc/group\fR\fR
 369  367  .ad
 370  368  .RS 15n
 371  369  group file
 372  370  .RE
 373  371  
 374  372  .SH SEE ALSO
 375      -.sp
 376      -.LP
 377  373  \fBchmod\fR(1), \fBgetfacl\fR(1), \fBumask\fR(1), \fBaclcheck\fR(3SEC),
 378      -\fBaclsort\fR(3SEC), \fBgroup\fR(4), \fBpasswd\fR(4), \fBattributes\fR(5)
      374 +\fBaclsort\fR(3SEC), \fBgroup\fR(4), \fBpasswd\fR(4), \fBacl\fR(5),
      375 +\fBattributes\fR(5)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX