Print this page
12288 getfacl and setfacl could stand improvement
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3sec/aclcheck.3sec
+++ new/usr/src/man/man3sec/aclcheck.3sec
1 1 '\" te
2 2 .\" Copyright (c) 2001, Sun Microsystems, Inc.
3 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 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 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 6 .TH ACLCHECK 3SEC "Dec 10, 2001"
7 7 .SH NAME
8 8 aclcheck \- check the validity of an ACL
9 9 .SH SYNOPSIS
10 -.LP
11 10 .nf
12 11 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsec\fR [ \fIlibrary\fR... ]
13 12 #include <sys/acl.h>
14 13
15 14 \fBint\fR \fBaclcheck\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fInentries\fR, \fBint *\fR\fIwhich\fR);
16 15 .fi
17 16
18 17 .SH DESCRIPTION
19 -.sp
20 -.LP
21 18 The \fBaclcheck()\fR function checks the validity of an \fBACL\fR pointed to by
22 19 \fIaclbufp.\fR The \fInentries\fR argument is the number of entries contained
23 20 in the buffer. The \fIwhich\fR parameter returns the index of the first entry
24 21 that is invalid.
25 22 .sp
26 23 .LP
27 24 The function verifies that an \fBACL\fR pointed to by \fIaclbufp\fR is valid
28 25 according to the following rules:
29 26 .RS +4
30 27 .TP
31 28 .ie t \(bu
32 29 .el o
33 30 There must be exactly one \fBGROUP_OBJ\fR \fBACL\fR entry.
34 31 .RE
35 32 .RS +4
36 33 .TP
37 34 .ie t \(bu
38 35 .el o
39 36 There must be exactly one \fBUSER_OBJ\fR \fBACL\fR entry.
40 37 .RE
41 38 .RS +4
42 39 .TP
43 40 .ie t \(bu
44 41 .el o
45 42 There must be exactly one \fBOTHER_OBJ\fR \fBACL\fR entry.
46 43 .RE
47 44 .RS +4
48 45 .TP
49 46 .ie t \(bu
50 47 .el o
51 48 If there are any \fBGROUP\fR \fBACL\fR entries, then the group \fBID\fR in each
52 49 group \fBACL\fR entry must be unique.
53 50 .RE
54 51 .RS +4
55 52 .TP
56 53 .ie t \(bu
57 54 .el o
58 55 If there are any \fBUSER\fR \fBACL\fR entries, then the user \fBID\fR in each
59 56 user \fBACL\fR entry must be unique.
60 57 .RE
61 58 .RS +4
62 59 .TP
63 60 .ie t \(bu
64 61 .el o
65 62 If there are any \fBGROUP\fR or \fBUSER\fR \fBACL\fR entries, then there must
66 63 be exactly one \fBCLASS_OBJ\fR (\fBACL\fR mask) entry.
67 64 .RE
68 65 .RS +4
69 66 .TP
70 67 .ie t \(bu
71 68 .el o
72 69 If there are any default \fBACL\fR entries, then the following apply:
73 70 .RS +4
74 71 .TP
75 72 .ie t \(bu
76 73 .el o
77 74 There must be exactly one default \fBGROUP_OBJ\fR \fBACL\fR entry.
78 75 .RE
79 76 .RS +4
80 77 .TP
81 78 .ie t \(bu
82 79 .el o
83 80 There must be exactly one default \fBOTHER_OBJ\fR \fBACL\fR entry.
84 81 .RE
85 82 .RS +4
86 83 .TP
87 84 .ie t \(bu
88 85 .el o
89 86 There must be exactly one default \fBUSER_OBJ\fR \fBACL\fR entry.
90 87 .RE
91 88 .RS +4
92 89 .TP
93 90 .ie t \(bu
94 91 .el o
95 92 If there are any \fBDEF_GROUP\fR entries, then the group \fBID\fR in each
96 93 \fBDEF_GROUP\fR \fBACL\fR entry must be unique.
97 94 .RE
98 95 .RS +4
99 96 .TP
100 97 .ie t \(bu
101 98 .el o
102 99 If there are any \fBDEF_USER\fR entries, then the user \fBID\fR in each
103 100 \fBDEF_USER\fR \fBACL\fR entry must be unique.
104 101 .RE
105 102 .RS +4
106 103 .TP
107 104 .ie t \(bu
↓ open down ↓ |
77 lines elided |
↑ open up ↑ |
108 105 .el o
109 106 If there are any \fBDEF_GROUP\fR or \fBDEF_USER\fR entries, then there must be
110 107 exactly one \fBDEF_CLASS_OBJ\fR (default \fBACL\fR mask) entry.
111 108 .RE
112 109 .RE
113 110 .RS +4
114 111 .TP
115 112 .ie t \(bu
116 113 .el o
117 114 If any of the above rules are violated, then the function fails with
118 -\fBerrno\fR set to \fBEINVAL\fR.
115 +\fBerrno\fR set to \fBEINVAL\fR.
119 116 .RE
120 117 .SH RETURN VALUES
121 -.sp
122 -.LP
123 -If the \fBACL\fR is valid, \fBalcheck()\fR will return \fB0\fR. Otherwise
124 -\fBerrno\fR is set to \fBEINVAL\fR and return code is set to one of the
118 +If the \fBACL\fR is valid, \fBaclcheck()\fR will return \fB0\fR. Otherwise
119 +\fBerrno\fR is set to \fBEINVAL\fR and \fBaclcheck()\fR will return one of the
125 120 following:
126 121 .sp
127 122 .ne 2
128 123 .na
129 124 \fB\fBGRP_ERROR\fR\fR
130 125 .ad
131 126 .RS 19n
132 127 There is more than one \fBGROUP_OBJ\fR or \fBDEF_GROUP_OBJ\fR \fBACL\fR entry.
133 128 .RE
134 129
135 130 .sp
136 131 .ne 2
137 132 .na
138 133 \fB\fBUSER_ERROR\fR\fR
139 134 .ad
140 135 .RS 19n
141 136 There is more than one \fBUSER_OBJ\fR or \fBDEF_USER_OBJ\fR \fBACL\fR entry.
142 137 .RE
143 138
144 139 .sp
145 140 .ne 2
146 141 .na
147 142 \fB\fBCLASS_ERROR\fR\fR
148 143 .ad
149 144 .RS 19n
150 145 There is more than one \fBCLASS_OBJ\fR (\fBACL\fR mask) or \fBDEF_CLASS_OBJ\fR
151 146 (default \fBACL\fR mask) entry.
152 147 .RE
153 148
154 149 .sp
155 150 .ne 2
156 151 .na
157 152 \fB\fBOTHER_ERROR\fR\fR
158 153 .ad
159 154 .RS 19n
160 155 There is more than one \fBOTHER_OBJ\fR or \fBDEF_OTHER_OBJ\fR \fBACL\fR entry.
161 156 .RE
162 157
163 158 .sp
164 159 .ne 2
165 160 .na
166 161 \fB\fBDUPLICATE_ERROR\fR\fR
167 162 .ad
168 163 .RS 19n
169 164 Duplicate entries of \fBUSER\fR, \fBGROUP\fR, \fBDEF_USER\fR, or
170 165 \fBDEF_GROUP\fR.
171 166 .RE
172 167
173 168 .sp
174 169 .ne 2
175 170 .na
176 171 \fB\fBENTRY_ERROR\fR\fR
177 172 .ad
178 173 .RS 19n
179 174 The entry type is invalid.
180 175 .RE
181 176
182 177 .sp
183 178 .ne 2
184 179 .na
185 180 \fB\fBMISS_ERROR\fR\fR
186 181 .ad
187 182 .RS 19n
188 183 Missing an entry. The \fIwhich\fR parameter returns \fB\(mi1\fR in this case.
189 184 .RE
190 185
191 186 .sp
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
192 187 .ne 2
193 188 .na
194 189 \fB\fBMEM_ERROR\fR\fR
195 190 .ad
196 191 .RS 19n
197 192 The system cannot allocate any memory. The \fBwhich\fR parameter returns
198 193 \fB\(mi1\fR in this case.
199 194 .RE
200 195
201 196 .SH ATTRIBUTES
202 -.sp
203 -.LP
204 197 See \fBattributes\fR(5) for descriptions of the following attributes:
205 198 .sp
206 199
207 200 .sp
208 201 .TS
209 202 box;
210 203 c | c
211 204 l | l .
212 205 ATTRIBUTE TYPE ATTRIBUTE VALUE
213 206 _
214 207 Interface Stability Evolving
215 208 _
216 209 MT-Level Unsafe
217 210 .TE
218 211
219 212 .SH SEE ALSO
220 -.sp
221 -.LP
222 213 \fBacl\fR(2), \fBaclsort\fR(3SEC), \fBattributes\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX