2 .\" Copyright (c) 2007, 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 ACL 2 "Jan 10, 2007"
8 acl, facl \- get or set a file's Access Control List (ACL)
14 \fBint\fR \fBacl\fR(\fBchar *\fR\fIpathp\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fInentries\fR, \fBvoid *\fR\fIaclbufp\fR);
19 \fBint\fR \fBfacl\fR(\fBint\fR \fIfildes\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fInentries\fR, \fBvoid *\fR\fIaclbufp\fR);
25 The \fBacl()\fR and \fBfacl()\fR functions get or set the \fBACL\fR of a file
26 whose name is given by \fIpathp\fR or referenced by the open file descriptor
27 \fIfildes\fR. The \fInentries\fR argument specifies how many \fBACL\fR entries
28 fit into buffer \fIaclbufp\fR. The \fBacl()\fR function is used to manipulate
29 \fBACL\fR on file system objects.
32 The following types are supported for \fIaclbufp\fR:
39 Used by the UFS file system.
48 Used by the ZFS and NFSv4 file systems.
53 The following values for \fIcmd\fR are supported:
60 \fInentries\fR \fBaclent_t\fR \fBACL\fR entries, specified in buffer
61 \fIaclbufp\fR, are stored in the file's \fBACL\fR. All directories in the path
62 name must be searchable.
71 Buffer \fIaclbufp\fR is filled with the file's \fBaclent_t\fR \fBACL\fR
72 entries. Read access to the file is not required, but all directories in the
73 path name must be searchable.
82 The number of entries in the file's \fBaclent_t\fR \fBACL\fR is returned. Read
83 access to the file is not required, but all directories in the path name must
90 \fB\fBACE_SETACL\fR\fR
93 \fInentries\fR \fBace_t\fR ACL entries, specified in buffer \fIaclbufp\fR, are
94 stored in the file's ACL. All directories in the path name must be searchable.
95 Write ACL access is required to change the file's ACL.
101 \fB\fBACE_GETACL\fR\fR
104 Buffer \fIaclbufp\fR is filled with the file's \fBace_t\fR ACL entries. Read
105 access to the file is required and all directories in the path name must be
112 \fB\fBACE_GETACLCNT\fR\fR
115 The number of entries in the file's \fBace_t\fR ACL is returned. Read access
116 to the file is required and all directories in the path name must be
123 Upon successful completion, \fBacl()\fR and \fBfacl()\fR return \fB0\fR if
124 \fIcmd\fR is \fBSETACL\fR or \fBACE_SETACL\fR. If \fIcmd\fR is \fBGETACL\fR,
125 \fBGETACLCNT\fR, \fBACE_GETACL\fR or \fBACE_GETACLCNT\fR, the number of
126 \fBACL\fR entries is returned. Otherwise, \fB\(mi1\fR is returned and
127 \fBerrno\fR is set to indicate the error.
131 The \fBacl()\fR function will fail if:
138 The caller does not have access to a component of the pathname.
147 The \fIpathp\fR or \fIaclbufp\fR argument points to an illegal address.
156 The \fIcmd\fR argument is not \fBGETACL\fR, \fBSETACL\fR, \fBACE_GETACL\fR,
157 \fBGETACLCNT\fR, or \fBACE_GETACLCNT\fR; the \fIcmd\fR argument is
158 \fBSETACL\fR and \fInentries\fR is less than 3; or the \fIcmd\fR argument is
159 \fBSETACL\fR or \fBACE_SETACL\fR and the \fBACL\fR specified in \fIaclbufp\fR
169 A disk I/O error has occurred while storing or retrieving the \fBACL.\fR
178 A component of the path does not exist.
187 The \fIcmd\fR argument is \fBGETACL\fR and \fInentries\fR is less than the
188 number of entries in the file's \fBACL\fR, or the \fIcmd\fR argument is
189 \fBSETACL\fR and there is insufficient space in the file system to store the
199 The \fIcmd\fR argument is \fBSETACL\fR or \fBACE_SETACL\fR and the file
200 specified by \fIpathp\fR resides on a file system that does not support
201 \fBACLs\fR, or the \fBacl()\fR function is not supported by this
211 A component of the path specified by \fIpathp\fR is not a directory, or the
212 \fIcmd\fR argument is \fBSETACL\fR or \fBACE_SETACL\fR and an attempt is made
213 to set a default \fBACL\fR on a file type other than a directory.
222 The \fIcmd\fR argument is \fBGETACL\fR, but the ACL is composed of \fBace_t\fR
223 entries, and the ACL cannot be translated into \fBaclent_t\fR form.
225 The \fIcmd\fR argument is \fBACE_SETACL\fR, but the underlying filesystem only
226 supports ACLs composed of \fBaclent_t\fR entries and the ACL could not be
227 translated into \fBaclent_t\fR form.
236 The effective user \fBID\fR does not match the owner of the file and the
237 process does not have appropriate privilege.
246 The \fIcmd\fR argument is \fBSETACL\fR or \fBACE_SETACL\fR and the file
247 specified by \fIpathp\fR resides on a file system that is mounted read-only.
253 See \fBattributes\fR(5) for descriptions of the following attributes:
261 ATTRIBUTE TYPE ATTRIBUTE VALUE
263 Interface Stability Evolving
269 \fBgetfacl\fR(1), \fBsetfacl\fR(1), \fBaclcheck\fR(3SEC), \fBaclsort\fR(3SEC)