]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - lib/libc/posix1e/acl.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / lib / libc / posix1e / acl.3
1 .\"-
2 .\" Copyright (c) 2000, 2001, 2002 Robert N. M. Watson
3 .\" All rights reserved.
4 .\"
5 .\" This software was developed by Robert Watson for the TrustedBSD Project.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd November 12, 2013
31 .Dt ACL 3
32 .Os
33 .Sh NAME
34 .Nm acl
35 .Nd introduction to the POSIX.1e ACL security API
36 .Sh LIBRARY
37 .Lb libc
38 .Sh SYNOPSIS
39 .In sys/types.h
40 .In sys/acl.h
41 .Sh DESCRIPTION
42 .Fx
43 permits file systems to export Access Control Lists via the VFS, and
44 provides a library for userland access to and manipulation of these ACLs.
45 Not all file systems provide support for ACLs, and some may require that
46 ACL support be explicitly enabled by the administrator.
47 The library calls include routines to allocate, duplicate, retrieve, set,
48 and validate ACLs associated with file objects.
49 As well as the POSIX.1e routines, there are a number of non-portable
50 extensions defined that allow for alternative ACL semantics than the
51 POSIX.1e semantics, such as NFSv4, AFS, NTFS, Coda, and NWFS semantics.
52 Where routines are non-standard, they are suffixed with _np to indicate that
53 they are not portable.
54 .Pp
55 POSIX.1e describes a set of ACL manipulation routines to manage the
56 contents of ACLs, as well as their relationships with files; almost
57 all of these support routines are implemented in
58 .Fx .
59 .Pp
60 Available functions, sorted by behavior, include:
61 .Bl -tag -width indent
62 .It Fn acl_add_flag_np
63 This function is described in
64 .Xr acl_add_flag_np 3 ,
65 and may be used to add flags to a flagset.
66 .It Fn acl_add_perm
67 This function is described in
68 .Xr acl_add_perm 3 ,
69 and may be used to add permissions to a permission set.
70 .It Fn acl_calc_mask
71 This function is described in
72 .Xr acl_calc_mask 3 ,
73 and may be used to calculate and set the permissions associated with
74 the
75 .Dv ACL_MASK
76 entry.
77 .It Fn acl_clear_flags_np
78 This function is described in
79 .Xr acl_clear_flags_np 3 ,
80 and may be used to clear all flags from a flagset.
81 .It Fn acl_clear_perms
82 This function is described in
83 .Xr acl_clear_perms 3 ,
84 and may be used to clear all permissions from a permission set.
85 .It Fn acl_copy_entry
86 This function is described in
87 .Xr acl_copy_entry 3 ,
88 and may be used to copy the contents of an ACL entry.
89 .It Xo
90 .Fn acl_create_entry ,
91 .Fn acl_create_entry_np
92 .Xc
93 These functions are described in
94 .Xr acl_create_entry 3 ,
95 and may be used to create an empty entry in an ACL.
96 .It Xo
97 .Fn acl_delete_def_file ,
98 .Fn acl_delete_def_link_np ,
99 .Fn acl_delete_fd_np ,
100 .Fn acl_delete_file_np ,
101 .Fn acl_delete_link_np
102 .Xc
103 These functions are described in
104 .Xr acl_delete 3 ,
105 and may be used to delete ACLs from file system objects.
106 .It Xo
107 .Fn acl_delete_entry ,
108 .Fn acl_delete_entry_np ,
109 .Xc
110 This functions are described in
111 .Xr acl_delete_entry 3 ,
112 and may be used to delete an entry from an ACL.
113 .It Fn acl_delete_flag_np
114 This function is described in
115 .Xr acl_delete_flag_np 3 ,
116 and may be used to delete flags from a flagset.
117 .It Fn acl_delete_perm
118 This function is described in
119 .Xr acl_delete_perm 3 ,
120 and may be used to delete permissions from a permset.
121 .It Fn acl_dup
122 This function is described in
123 .Xr acl_dup 3 ,
124 and may be used to duplicate an ACL structure.
125 .It Fn acl_free
126 This function is described in
127 .Xr acl_free 3 ,
128 and may be used to free userland working ACL storage.
129 .It Fn acl_from_text
130 This function is described in
131 .Xr acl_from_text 3 ,
132 and may be used to convert a text-form ACL into working ACL state, if
133 the ACL has POSIX.1e or NFSv4 semantics.
134 .It Fn acl_get_brand_np
135 This function is described in
136 .Xr acl_get_brand_np 3
137 and may be used to determine whether the ACL has POSIX.1e or NFSv4 semantics.
138 .It Fn acl_get_entry
139 This function is described in
140 .Xr acl_get_entry 3 ,
141 and may be used to retrieve a designated ACL entry from an ACL.
142 .It Xo
143 .Fn acl_get_fd ,
144 .Fn acl_get_fd_np ,
145 .Fn acl_get_file ,
146 .Fn acl_get_link_np
147 .Xc
148 These functions are described in
149 .Xr acl_get 3 ,
150 and may be used to retrieve ACLs from file system objects.
151 .It Fn acl_get_entry_type_np
152 This function is described in
153 .Xr acl_get_entry_type_np 3 ,
154 and may be used to retrieve an ACL type from an ACL entry.
155 .It Fn acl_get_flagset_np
156 This function is described in
157 .Xr acl_get_flagset_np 3 ,
158 and may be used to retrieve a flagset from an ACL entry.
159 .It Fn acl_get_permset
160 This function is described in
161 .Xr acl_get_permset 3 ,
162 and may be used to retrieve a permset from an ACL entry.
163 .It Fn acl_get_qualifier
164 This function is described in
165 .Xr acl_get_qualifier 3 ,
166 and may be used to retrieve the qualifier from an ACL entry.
167 .It Fn acl_get_tag_type
168 This function is described in
169 .Xr acl_get_tag_type 3 ,
170 and may be used to retrieve the tag type from an ACL entry.
171 .It Fn acl_init
172 This function is described in
173 .Xr acl_init 3 ,
174 and may be used to allocate a fresh (empty) ACL structure.
175 .It Fn acl_is_trivial_np
176 This function is described in
177 .Xr acl_is_trivial_np 3 ,
178 and may be used to find out whether ACL is trivial.
179 .It Xo
180 .Fn acl_set_fd ,
181 .Fn acl_set_fd_np ,
182 .Fn acl_set_file ,
183 .Fn acl_set_link_np
184 .Xc
185 These functions are described in
186 .Xr acl_set 3 ,
187 and may be used to assign an ACL to a file system object.
188 .It Fn acl_set_entry_type_np
189 This function is described in
190 .Xr acl_set_entry_type_np 3 ,
191 and may be used to set the ACL type of an ACL entry.
192 .It Fn acl_set_flagset_np
193 This function is described in
194 .Xr acl_set_flagset_np 3 ,
195 and may be used to set the flags of an ACL entry from a flagset.
196 .It Fn acl_set_permset
197 This function is described in
198 .Xr acl_set_permset 3 ,
199 and may be used to set the permissions of an ACL entry from a permset.
200 .It Fn acl_set_qualifier
201 This function is described in
202 .Xr acl_set_qualifier 3 ,
203 and may be used to set the qualifier of an ACL.
204 .It Fn acl_set_tag_type
205 This function is described in
206 .Xr acl_set_tag_type 3 ,
207 and may be used to set the tag type of an ACL.
208 .It Fn acl_strip_np
209 This function is described in
210 .Xr acl-strip_np 3 ,
211 and may be used to remove extended entries from an ACL.
212 .It Xo
213 .Fn acl_to_text ,
214 .Fn acl_to_text_np
215 .Xc
216 These functions are described in
217 .Xr acl_to_text 3 ,
218 and may be used to generate a text-form of a POSIX.1e or NFSv4 semantics ACL.
219 .It Xo
220 .Fn acl_valid ,
221 .Fn acl_valid_fd_np ,
222 .Fn acl_valid_file_np ,
223 .Fn acl_valid_link_np
224 .Xc
225 These functions are described in
226 .Xr acl_valid 3 ,
227 and may be used to validate an ACL as correct POSIX.1e-semantics, or
228 as appropriate for a particular file system object regardless of semantics.
229 .El
230 .Pp
231 Documentation of the internal kernel interfaces backing these calls may
232 be found in
233 .Xr acl 9 .
234 The syscalls between the internal interfaces and the public library
235 routines may change over time, and as such are not documented.
236 They are not intended to be called directly without going through the
237 library.
238 .Sh SEE ALSO
239 .Xr getfacl 1 ,
240 .Xr setfacl 1 ,
241 .Xr acl_add_flag_np 3 ,
242 .Xr acl_add_perm 3 ,
243 .Xr acl_calc_mask 3 ,
244 .Xr acl_clear_flags_np 3 ,
245 .Xr acl_clear_perms 3 ,
246 .Xr acl_copy_entry 3 ,
247 .Xr acl_create_entry 3 ,
248 .Xr acl_delete_entry 3 ,
249 .Xr acl_delete_flag_np 3 ,
250 .Xr acl_delete_perm 3 ,
251 .Xr acl_dup 3 ,
252 .Xr acl_free 3 ,
253 .Xr acl_from_text 3 ,
254 .Xr acl_get 3 ,
255 .Xr acl_get_brand_np 3 ,
256 .Xr acl_get_entry_type_np 3 ,
257 .Xr acl_get_flagset_np 3 ,
258 .Xr acl_get_permset 3 ,
259 .Xr acl_get_qualifier 3 ,
260 .Xr acl_get_tag_type 3 ,
261 .Xr acl_init 3 ,
262 .Xr acl_is_trivial_np 3 ,
263 .Xr acl_set 3 ,
264 .Xr acl_set_entry_type_np 3 ,
265 .Xr acl_set_flagset_np 3 ,
266 .Xr acl_set_permset 3 ,
267 .Xr acl_set_qualifier 3 ,
268 .Xr acl_set_tag_type 3 ,
269 .Xr acl_strip_np 3 ,
270 .Xr acl_to_text 3 ,
271 .Xr acl_valid 3 ,
272 .Xr posix1e 3 ,
273 .Xr acl 9
274 .Sh STANDARDS
275 POSIX.1e assigns security labels to all objects, extending the security
276 functionality described in POSIX.1.
277 These additional labels provide fine-grained discretionary access control,
278 fine-grained capabilities, and labels necessary for mandatory access
279 control.
280 POSIX.2c describes a set of userland utilities for manipulating these
281 labels.
282 .Pp
283 POSIX.1e is described in IEEE POSIX.1e draft 17.
284 Discussion of the draft continues on the cross-platform POSIX.1e
285 implementation mailing list.
286 To join this list, see the
287 .Fx
288 POSIX.1e implementation page for more information.
289 .Sh HISTORY
290 POSIX.1e support was introduced in
291 .Fx 4.0 ;
292 .Fx 5.0
293 was the first version to include a complete ACL implementation based
294 on extended attributes for the UFS and UFS2 file systems.
295 .Pp
296 The
297 .Xr getfacl 1
298 and
299 .Xr setfacl 1
300 utilities describe the user tools that permit direct manipulation of complete
301 file ACLs.
302 .Sh AUTHORS
303 .An Robert N M Watson