2 .\" Copyright (c) 2005, 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_GET 3SEC "April 9, 2016"
8 acl_get, facl_get, acl_set, facl_set \- get or set a file's Access Control List
13 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lsec\fR [ \fIlibrary\fR\&.\|.\|. ]
16 \fBint *\fR\fBacl_get\fR(\fBconst char *\fR\fIpath\fR, \fBint\fR \fIflag\fR, \fBacl_t **\fR\fIaclp\fR);
21 \fBint *\fR\fBfacl_get\fR(\fBint\fR \fIfd\fR, \fBint\fR \fIflag\fR, \fBacl_t **\fR\fIaclp\fR);
26 \fBint\fR \fBacl_set\fR(\fBconst char *\fR\fIpath\fR, \fBacl_t *\fR\fIaclp\fR);
31 \fBint\fR \fBfacl_set\fR(\fBint\fR \fIfd\fR, \fBacl_t *\fR\fIaclp\fR);
36 The \fBacl_get()\fR and \fBfacl_get()\fR functions retrieve an Access Control
37 List (ACL) of a file whose name is given by \fIpath\fR or referenced by the
38 open file descriptor \fIfd\fR. The \fIflag\fR argument specifies whether a
39 trivial ACL should be retrieved. When the \fIflag\fR argument is
40 \fBACL_NO_TRIVIAL\fR, only ACLs that are not trivial will be retrieved. The ACL
41 is returned in the \fIaclp\fR argument.
44 The \fBacl_set()\fR and \fBfacl_set()\fR functions are used for setting an ACL
45 of a file whose name is given by \fIpath\fR or referenced by the open file
46 descriptor \fIfd\fR. The \fIaclp\fR argument specifies the ACL to set.
49 The \fBacl_get()\fR and \fBacl_set()\fR functions support multiple types of
50 ACLs. When possible, the \fBacl_set()\fR function translates an ACL to the
51 target file's style of ACL. Currently this is only possible when translating
52 from a POSIX-draft ACL such as on UFS to a file system that supports NFSv4 ACL
53 semantics such as ZFS or NFSv4.
56 Upon successful completion, \fBacl_get()\fR and \fBfacl_get()\fR return 0 and
57 \fIaclp\fR is non-\fINULL\fR. The \fIaclp\fR argument can be \fINULL\fR after
58 successful completion if the file had a trivial ACL and the \fIflag\fR argument
59 was \fBACL_NO_TRIVIAL\fR. Otherwise, -1 is returned and \fBerrno\fR is set to
63 Upon successful completion, \fBacl_set()\fR and \fBfacl_set()\fR return 0.
64 Otherwise, -1 is returned and \fBerrno\fR is set to indicate the error.
67 These functions will fail if:
74 The caller does not have access to a component of \fIpath\fR.
83 A disk I/O error has occurred while retrieving the ACL.
92 A component of the \fIpath\fR does not exist.
101 The file system does not support ACLs.
110 The ACL supplied could not be translated to an NFSv4 ACL.
115 See \fBattributes\fR(5) for descriptions of the following attributes:
123 ATTRIBUTE TYPE ATTRIBUTE VALUE
125 Interface Stability Evolving
132 \fBchmod\fR(1), \fBacl\fR(2), \fBacl\fR(5), \fBattributes\fR(5)