Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man3sec / acl_check.3sec
blob6b866b4192908d103e67a18318185afd424828eb
1 '\" te
2 .\" Copyright (c) 2008, 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_CHECK 3SEC "Apr 22, 2008"
7 .SH NAME
8 acl_check \- check the validity of an ACL
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lsec\fR [ \fIlibrary\fR\&.\|.\|. ]
13 #include <sys/acl.h>
15 \fBint\fR \fBacl_check\fR(\fBacl_t *\fR\fIaclp\fR, \fBint\fR \fIisdir\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fBacl_check()\fR function checks the validity of an ACL pointed to by
22 \fIaclp\fR. The \fIisdir\fR argument checks the validity of an ACL that will be
23 applied to a directory. The ACL can be either a POSIX draft ACL as supported by
24 UFS or NFSv4 ACL as supported by ZFS or NFSV4.
25 .sp
26 .LP
27 When the function verifies a POSIX draft ACL, the rules followed are described
28 in \fBaclcheck\fR(3SEC). For NFSv4 ACL, the ACL is verified against the
29 following rules:
30 .RS +4
31 .TP
32 .ie t \(bu
33 .el o
34 The inheritance flags are valid.
35 .RE
36 .RS +4
37 .TP
38 .ie t \(bu
39 .el o
40 The ACL must have at least one ACL entry and no more than
41 {\fBMAX_ACL_ENTRIES\fR}.
42 .RE
43 .RS +4
44 .TP
45 .ie t \(bu
46 .el o
47 The permission field contains only supported permissions.
48 .RE
49 .RS +4
50 .TP
51 .ie t \(bu
52 .el o
53 The entry type is valid.
54 .RE
55 .RS +4
56 .TP
57 .ie t \(bu
58 .el o
59 The flag fields contain only valid flags as supported by NFSv4/ZFS.
60 .RE
61 .sp
62 .LP
63 If any of the above rules are violated, the function fails with \fBerrno\fR set
64 to \fBEINVAL\fR.
65 .SH RETURN VALUES
66 .sp
67 .LP
68 If the ACL is valid, \fBacl_check()\fR returns 0. Otherwise \fBerrno\fR is set
69 to \fBEINVAL\fR and the return value is set to one of the following:
70 .sp
71 .ne 2
72 .na
73 \fB\fBEACL_INHERIT_ERROR\fR\fR
74 .ad
75 .RS 23n
76 There are invalid inheritance flags specified.
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBEACL_FLAGS_ERROR\fR\fR
83 .ad
84 .RS 23n
85 There are invalid flags specified on the ACL that don't map to supported flags
86 in NFSV4/ZFS ACL model.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fBEACL_ENTRY_ERROR\fR\fR
93 .ad
94 .RS 23n
95 The ACL contains an unknown value in the type field.
96 .RE
98 .sp
99 .ne 2
101 \fB\fBEACL_MEM_ERROR\fR\fR
103 .RS 23n
104 The system cannot allocate any memory.
108 .ne 2
110 \fB\fBEACL_INHERIT_NOTDIR\fR\fR
112 .RS 23n
113 Inheritance flags are only allowed for ACLs on directories.
116 .SH ATTRIBUTES
119 See \fBattributes\fR(5) for descriptions of the following attributes:
124 box;
125 c | c
126 l | l .
127 ATTRIBUTE TYPE  ATTRIBUTE VALUE
129 Interface Stability     Committed
131 MT-Level        MT-Safe
134 .SH SEE ALSO
137 \fBacl\fR(2), \fBaclcheck\fR(3SEC), \fBaclsort\fR(3SEC), \fBacl\fR(5),
138 \fBattributes\fR(5)