xref: /freebsd/lib/libc/posix1e/acl.3 (revision a889d1fb766450bff9b27c3bccfe18fc39cd753d)
1.\"-
2.\" Copyright (c) 2000 Robert N. M. Watson
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\"       $FreeBSD$
27.\"
28.Dd January 28, 2000
29.Dt ACL 3
30.Os FreeBSD 4.0
31.Sh NAME
32.Nm acl \- introduction to the POSIX.1e ACL security API
33.Sh SYNOPSIS
34.Fd #include <sys/types.h>
35.Fd #include <sys/acl.h>
36.Sh DESCRIPTION
37As shipped, FreeBSD 4.0 permits file systems to export
38Access Control Lists via the VFS, and provides a library for userland
39access to and manipulation of these ACLs, but support for ACLs is not
40provided by any file systems shipped in the base operating system.
41The library calls shipped with 4.0 include routines to allocate,
42duplicate, retrieve, set, and validate ACLs associated with file objects.
43As well as the POSIX.1e routines, there are a number of non-portable
44extensions defined that allow for alternative ACL semantics than the
45POSIX.1e semantics, such as AFS, NTFS, Coda, and NWFS semantics.  Where
46routines are non-standard, they are suffixed with _np to indicate that
47they are not portable.
48
49POSIX.1e describes a set of ACL manipulation routines to manage the
50contents of ACLs, as well as their relationships with files.  This
51manipulation library is not currently implemented in FreeBSD, although
52a third party library was under development at the time this document
53was written.  There is a general concensus that the POSIX.1e manipulation
54routines are ambiguously defined in the specification, and don't meet the
55needs of most applications.  For the time being, applications may
56directly manipulate the ACL structures, defined in acl.h, although the
57recommended usage is to only ever handle text-form ACLs in applications,
58generated and maintained using
59.Fn acl_from_text
60and
61.Fn acl_to_text ,
62passed directly to and from the management routines.  In this manner,
63an application can remain safely unaware of the contents of ACLs.
64
65Available functions, sorted by behavior, include:
66
67.Fn acl_delete_def_file ,
68.Fn acl_delete_file_np ,
69.Fn acl_delete_fd_np
70
71These functions are described in
72.Xr acl_delete 3 ,
73and may be used to delete ACLs from file system objects.
74
75.Fn acl_free
76
77This function is described in
78.Xr acl_free 3 ,
79and may be used to free userland working ACL storage.
80
81.Fn acl_from_text
82
83This function is described in
84.Xr acl_from_text 3 ,
85and may be used to convert a text-form ACL into working ACL state, if
86the ACL has POSIX.1e semantics.
87
88.Fn acl_get_file ,
89.Fn acl_get_fd ,
90.Fn acl_get_fd_np
91
92These functions are described in
93.Xr acl_get 3 ,
94and may be used to retrieve ACLs from file system objects.
95
96.Fn acl_init
97
98This function is described in
99.Xr acl_init 3 ,
100and may be used to allocate a fresh (empty) ACL structure.
101
102.Fn acl_dup
103
104This function is described in
105.Xr acl_dup 3 ,
106and may be used to duplicate an ACL structure.
107
108.Fn acl_set_file ,
109.Fn acl_set_fd ,
110.Fn acl_set_fd_np
111
112These funtions are described in
113.Xr acl_set 3 ,
114and may be used to assign an ACL to a file system object.
115
116.Fn acl_to_text
117
118This function is described in
119.Xr acl_to_text 3 ,
120and may be used to generate a text-form of a POSIX.1e semantics ACL.
121
122.Fn acl_valid ,
123.Fn acl_valid_file_np ,
124.Fn acl_valid_fd_np
125
126Thee functions are described in
127.Xr acl_valid 3 ,
128and may be used to validate an ACL as correct POSIX.1e-semantics, or
129as appropriate for a particular file system object regardless of semantics.
130
131Documentation of the internal kernel interfaces backing these calls may
132be found in
133.Xr acl 9 .
134The syscalls between the internal interfaces and the public library
135routines may change over time, and as such are not documented.  They are
136not intended to be called directly without going through the library.
137.Sh IMPLEMENTATION NOTES
138FreeBSD's support for POSIX.1e interfaces and features is still under
139development at this time.
140.Sh ENVIRONMENT
141POSIX.1e assigns security labels to all objects, extending the security
142functionality described in POSIX.1.  These additional labels provide
143fine-grained discretionary access control, fine-grained capabilities,
144and labels necessary for mandatory access control.  POSIX.2c describes
145a set of userland utilities for manipulating these labels.  These userland
146utilities are not bundled with FreeBSD 4.0 so as to discourage their
147use in the short term.
148.Sh FILES
149.Sh SEE ALSO
150.Xr acl 3 ,
151.Xr acl_dup 3 ,
152.Xr acl_free 3 ,
153.Xr acl_from_text 3 ,
154.Xr acl_get 3 ,
155.Xr acl_set 3 ,
156.Xr acl_to_text 3 ,
157.Xr acl_valid 3 ,
158.Xr acl 9
159.Sh STANDARDS
160POSIX.1e is described in IEEE POSIX.1e draft 17.  Discussion
161of the draft continues on the cross-platform POSIX.1e implementation
162mailing list.  To join this list, see the FreeBSD POSIX.1e implementation
163page for more information.
164.Sh HISTORY
165POSIX.1e support was introduced in FreeBSD 4.0, and development continues.
166.Sh AUTHORS
167Robert N M Watson
168.Sh BUGS
169These features are not yet fully implemented.  In particular, the shipped
170version of UFS/FFS does not support storage of additional security labels,
171and so is unable to (easily) provide support for most of these features.
172