2 .\" \&.Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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 .\" 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 .\" 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 GETFACL 1 "Nov 5, 1994"
8 getfacl \- display discretionary file information
12 \fBgetfacl\fR [\fB-ad\fR] \fIfile\fR...
18 For each argument that is a regular file, special file, or named pipe, the
19 \fBgetfacl\fR utility displays the owner, the group, and the Access Control
20 List (\fBACL\fR). For each directory argument, \fBgetfacl\fR displays the
21 owner, the group, and the \fBACL\fR and/or the default \fBACL\fR. Only
22 directories contain default \fBACL\fRs.
25 The \fBgetfacl\fR utility may be executed on a file system that does not
26 support \fBACL\fRs. It reports the \fBACL\fR based on the base permission bits.
29 With no options specified, \fBgetfacl\fR displays the filename, the file owner,
30 the file group owner, and both the \fBACL\fR and the default \fBACL\fR, if it
35 The following options are supported:
42 Displays the filename, the file owner, the file group owner, and the \fBACL\fR
52 Displays the filename, the file owner, the file group owner, and the default
53 \fBACL\fR of the file, if it exists.
59 The following operands are supported:
66 The path name of a regular file, special file, or named pipe.
72 The format for \fBACL\fR output is as follows:
88 default:group:gid:perm
97 When multiple files are specified on the command line, a blank line separates
98 the \fBACL\fRs for each file.
101 The \fBACL\fR entries are displayed in the order in which they are evaluated
102 when an access check is performed. The default \fBACL\fR entries that may exist
103 on a directory have no effect on access checks.
106 The first three lines display the filename, the file owner, and the file group
107 owner. Notice that when only the \fB-d\fR option is specified and the file has
108 no default \fBACL\fR, only these three lines are displayed.
111 The \fBuser\fR entry without a user \fBID\fR indicates the permissions that
112 are granted to the file owner. One or more additional user entries indicate the
113 permissions that are granted to the specified users.
116 The \fBgroup\fR entry without a group \fBID\fR indicates the permissions that
117 are granted to the file group owner. One or more additional group entries
118 indicate the permissions that are granted to the specified groups.
121 The \fBmask\fR entry indicates the \fBACL\fR mask permissions. These are the
122 maximum permissions allowed to any user entries except the file owner, and to
123 any group entries, including the file group owner. These permissions restrict
124 the permissions specified in other entries.
127 The \fBother\fR entry indicates the permissions that are granted to others.
130 The \fBdefault\fR entries may exist only for directories. These entries
131 indicate the default entries that are added to a file created within the
135 The \fBuid\fR is a login name or a user \fBID\fR if there is no entry for the
136 \fBuid\fR in the system password file, \fB/etc/passwd\fR. The \fBgid\fR is a
137 group name or a group \fBID\fR if there is no entry for the \fBgid\fR in the
138 system group file, \fB/etc/group\fR. The \fBperm\fR is a three character string
139 composed of the letters representing the separate discretionary access rights:
140 \fBr\fR (read), \fBw\fR (write), \fBx\fR (execute/search), or the place holder
141 character \fB\(mi\fR\&. The \fBperm\fR is displayed in the following order:
142 \fBrwx\fR. If a permission is not granted by an \fBACL\fR entry, the place
143 holder character appears.
146 If you use the \fBchmod\fR(1) command to change the file group owner
147 permissions on a file with \fBACL\fR entries, both the file group owner
148 permissions and the \fBACL\fR mask are changed to the new permissions. Be aware
149 that the new \fBACL\fR mask permissions may change the effective permissions
150 for additional users and groups who have \fBACL\fR entries on the file.
153 In order to indicate that the \fBACL\fR mask restricts an \fBACL\fR entry,
154 \fBgetfacl\fR displays an additional tab character, pound sign (\fB#\fR), and
155 the actual permissions granted, following the entry.
158 \fBExample 1 \fRDisplaying file information
161 Given file \fBfoo\fR, with an \fBACL\fR six entries long, the command
166 host% \fBgetfacl foo\fR
182 user:spy:\|\(mi\|\(mi\|\(mi
183 user:mookie:r\|\(mi\|\(mi
186 other::\|\(mi\|\(mi\|\(mi
192 \fBExample 2 \fRDisplaying information after chmod command
195 Continue with the above example, after \fBchmod\fR \fB700 foo\fR was issued:
200 host% \fBgetfacl foo\fR
216 user:spy:\|\(mi\|\(mi\|\(mi
217 user:mookie:r\|\(mi\|\(mi #effective:\|\(mi\|\(mi\|\(mi
218 group::\|\(mi\|\(mi\|\(mi
219 mask::\|\(mi\|\(mi\|\(mi
220 other::\|\(mi\|\(mi\|\(mi
226 \fBExample 3 \fRDisplaying information when ACL contains default entries
229 Given directory \fBdoo\fR, with an \fBACL\fR containing default entries, the
235 host% \fBgetfacl -d doo\fR
251 default:user:spy:\|\(mi\|\(mi\|\(mi
252 default:user:mookie:r\|\(mi\|\(mi
253 default:group::r\|\(mi\|\(mi
254 default:mask::\|\(mi\|\(mi\|\(mi
255 default:other::\|\(mi\|\(mi\|\(mi
264 \fB\fB/etc/passwd\fR\fR
273 \fB\fB/etc/group\fR\fR
282 See \fBattributes\fR(5) for descriptions of the following attributes:
290 ATTRIBUTE TYPE ATTRIBUTE VALUE
292 Interface Stability Evolving
298 \fBchmod\fR(1), \fBls\fR(1), \fBsetfacl\fR(1), \fBacl\fR(2),
299 \fBaclsort\fR(3SEC), \fBgroup\fR(4), \fBpasswd\fR(4), \fBattributes\fR(5)
303 The output from \fBgetfacl\fR is in the correct format for input to the
304 \fBsetfacl\fR \fB-f\fR command. If the output from \fBgetfacl\fR is redirected
305 to a file, the file may be used as input to \fBsetfacl\fR. In this way, a user
306 may easily assign one file's \fBACL\fR to another file.