2 .\" Copyright (c) 2001 Chris D. Faulhaber
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE
18 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 .\" POSSIBILITY OF SUCH DAMAGE.
33 .Nd set ACL information
45 utility sets discretionary access control information on
46 the specified file(s).
47 If no files are specified, or the list consists of the only
49 the file names are taken from the standard input.
51 The following options are available:
52 .Bl -tag -width indent
54 Remove all ACL entries except for the three required entries.
57 entry, the permissions of the
59 entry in the resulting ACL will be set to the permission
60 associated with both the
64 entries of the current ACL.
66 The operations apply to the default ACL entries instead of
68 Currently only directories may have
71 If the target of the operation is a symbolic link, perform the operation
72 on the symbolic link itself, rather than following the link.
74 Delete any default ACL entries on the specified files.
76 is not considered an error if the specified files do not have
77 any default ACL entries.
78 An error will be reported if any of
79 the specified files cannot have a default entry (i.e.\&
82 Modify the ACL entries on the specified files by adding new
83 entries and modifying existing ACL entries with the ACL entries
87 Modify the ACL entries on the specified files by adding new
88 ACL entries and modifying existing ACL entries with the ACL
89 entries specified in the file
95 the input is taken from stdin.
97 Do not recalculate the permissions associated with the ACL
100 Remove the ACL entries specified in
102 from the access or default ACL of the specified files.
104 Remove the ACL entries specified in the file
106 from the access or default ACL of the specified files.
109 The above options are evaluated in the order specified
112 An ACL entry contains three colon-separated fields:
113 an ACL tag, an ACL qualifier, and discretionary access
115 .Bl -tag -width indent
117 The ACL tag specifies the ACL entry type and consists of
118 one of the following:
122 specifying the access
123 granted to the owner of the file or a specified user;
127 specifying the access granted to the file owning group
128 or a specified group;
132 specifying the access
133 granted to any process that does not match any user or group
138 specifying the maximum access
139 granted to any ACL entry except the
141 ACL entry for the file owner and the
144 .It Ar "ACL qualifier"
145 The ACL qualifier field describes the user or group associated with
147 It may consist of one of the following: uid or
148 user name, gid or group name, or empty.
151 ACL entries, an empty field specifies access granted to the
155 ACL entries, an empty field specifies access granted to the
160 ACL entries do not use this field.
161 .It Ar "access permissions"
162 The access permissions field contains up to one of each of
168 to set read, write, and
169 execute permissions, respectively.
170 Each of these may be excluded
173 character to indicate no access.
178 ACL entry is required on a file with any ACL entries other than
187 option is not specified and no
189 ACL entry was specified, the
194 ACL entry consisting of the union of the permissions associated
197 ACL entries in the resulting ACL.
199 Traditional POSIX interfaces acting on file system object modes have
200 modified semantics in the presence of POSIX.1e extended ACLs.
201 When a mask entry is present on the access ACL of an object, the mask
202 entry is substituted for the group bits; this occurs in programs such
207 When the mode is modified on an object that has a mask entry, the
208 changes applied to the group bits will actually be applied to the
210 These semantics provide for greater application compatibility:
211 applications modifying the mode instead of the ACL will see
212 conservative behavior, limiting the effective rights granted by all
213 of the additional user and group entries; this occurs in programs
217 ACL entries applied from a file using the
221 options shall be of the following form: one ACL entry per line, as
222 previously specified; whitespace is ignored; any text after a
224 is ignored (comments).
226 When ACL entries are evaluated, the access check algorithm checks
227 the ACL entries in the following order: file owner,
229 ACL entries, file owning group,
235 Multiple ACL entries specified on the command line are
238 It is possible for files and directories to inherit ACL entries from their
240 This is accomplished through the use of the default ACL.
241 It should be noted that before you can specify a default ACL, the mandatory
242 ACL entries for user, group, other and mask must be set.
243 For more details see the examples below.
244 Default ACLs can be created by using
249 .Dl setfacl -d -m u::rwx,g::rx,o::rx,mask::rwx dir
250 .Dl setfacl -d -m g:admins:rwx dir
252 The first command sets the mandatory elements of the default ACL.
253 The second command specifies that users in group admins can have read, write, and execute
254 permissions for directory named "dir".
255 It should be noted that any files or directories created underneath "dir" will
256 inherit these default ACLs upon creation.
258 .Dl setfacl -m u::rwx,g:mail:rw file
260 Sets read, write, and execute permissions for the
262 owner's ACL entry and read and write permissions for group mail on
265 .Dl setfacl -M file1 file2
267 Sets/updates the ACL entries contained in
272 .Dl setfacl -x g:mail:rw file
274 Remove the group mail ACL entry containing read/write permissions
282 ACL entries except for the three required from
285 .Dl getfacl file1 | setfacl -b -n -M - file2
287 Copy ACL entries from
301 utility is expected to be
303 Std 1003.2c compliant.
305 Extended Attribute and Access Control List support was developed
308 Project and introduced in
313 utility was written by
314 .An Chris D. Faulhaber Aq jedgar@fxp.org .