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 33.Nd introduction to the POSIX.1e ACL security API 34.Sh LIBRARY 35.Lb libposix1e 36.Sh SYNOPSIS 37.Fd #include <sys/types.h> 38.Fd #include <sys/acl.h> 39.Sh DESCRIPTION 40As shipped, 41.Fx 4.0 42permits file systems to export 43Access Control Lists via the VFS, and provides a library for userland 44access to and manipulation of these ACLs, but support for ACLs is not 45provided by any file systems shipped in the base operating system. 46The library calls shipped with 4.0 include routines to allocate, 47duplicate, retrieve, set, and validate ACLs associated with file objects. 48As well as the POSIX.1e routines, there are a number of non-portable 49extensions defined that allow for alternative ACL semantics than the 50POSIX.1e semantics, such as AFS, NTFS, Coda, and NWFS semantics. Where 51routines are non-standard, they are suffixed with _np to indicate that 52they are not portable. 53 54POSIX.1e describes a set of ACL manipulation routines to manage the 55contents of ACLs, as well as their relationships with files. This 56manipulation library is not currently implemented in FreeBSD, although 57a third party library was under development at the time this document 58was written. There is a general consensus that the POSIX.1e manipulation 59routines are ambiguously defined in the specification, and don't meet the 60needs of most applications. For the time being, applications may 61directly manipulate the ACL structures, defined in acl.h, although the 62recommended usage is to only ever handle text-form ACLs in applications, 63generated and maintained using 64.Fn acl_from_text 65and 66.Fn acl_to_text , 67passed directly to and from the management routines. In this manner, 68an application can remain safely unaware of the contents of ACLs. 69 70Available functions, sorted by behavior, include: 71 72.Fn acl_delete_def_file , 73.Fn acl_delete_file_np , 74.Fn acl_delete_fd_np 75 76These functions are described in 77.Xr acl_delete 3 , 78and may be used to delete ACLs from file system objects. 79 80.Fn acl_free 81 82This function is described in 83.Xr acl_free 3 , 84and may be used to free userland working ACL storage. 85 86.Fn acl_from_text 87 88This function is described in 89.Xr acl_from_text 3 , 90and may be used to convert a text-form ACL into working ACL state, if 91the ACL has POSIX.1e semantics. 92 93.Fn acl_get_file , 94.Fn acl_get_fd , 95.Fn acl_get_fd_np 96 97These functions are described in 98.Xr acl_get 3 , 99and may be used to retrieve ACLs from file system objects. 100 101.Fn acl_init 102 103This function is described in 104.Xr acl_init 3 , 105and may be used to allocate a fresh (empty) ACL structure. 106 107.Fn acl_dup 108 109This function is described in 110.Xr acl_dup 3 , 111and may be used to duplicate an ACL structure. 112 113.Fn acl_set_file , 114.Fn acl_set_fd , 115.Fn acl_set_fd_np 116 117These functions are described in 118.Xr acl_set 3 , 119and may be used to assign an ACL to a file system object. 120 121.Fn acl_to_text 122 123This function is described in 124.Xr acl_to_text 3 , 125and may be used to generate a text-form of a POSIX.1e semantics ACL. 126 127.Fn acl_valid , 128.Fn acl_valid_file_np , 129.Fn acl_valid_fd_np 130 131Thee functions are described in 132.Xr acl_valid 3 , 133and may be used to validate an ACL as correct POSIX.1e-semantics, or 134as appropriate for a particular file system object regardless of semantics. 135 136Documentation of the internal kernel interfaces backing these calls may 137be found in 138.Xr acl 9 . 139The syscalls between the internal interfaces and the public library 140routines may change over time, and as such are not documented. They are 141not intended to be called directly without going through the library. 142.Sh IMPLEMENTATION NOTES 143FreeBSD's support for POSIX.1e interfaces and features is still under 144development at this time. 145.Sh ENVIRONMENT 146POSIX.1e assigns security labels to all objects, extending the security 147functionality described in POSIX.1. These additional labels provide 148fine-grained discretionary access control, fine-grained capabilities, 149and labels necessary for mandatory access control. POSIX.2c describes 150a set of userland utilities for manipulating these labels. These userland 151utilities are not bundled with 152.Fx 4.0 153so as to discourage their 154use in the short term. 155.\" .Sh FILES 156.Sh SEE ALSO 157.Xr acl_dup 3 , 158.Xr acl_free 3 , 159.Xr acl_from_text 3 , 160.Xr acl_get 3 , 161.Xr acl_set 3 , 162.Xr acl_to_text 3 , 163.Xr acl_valid 3 , 164.Xr acl 9 , 165.Xr posix1e 3 166.Sh STANDARDS 167POSIX.1e is described in IEEE POSIX.1e draft 17. Discussion 168of the draft continues on the cross-platform POSIX.1e implementation 169mailing list. To join this list, see the 170.Fx 171POSIX.1e implementation 172page for more information. 173.Sh HISTORY 174POSIX.1e support was introduced in 175.Fx 4.0 , 176and development continues. 177.Sh AUTHORS 178.An Robert N M Watson 179.Sh BUGS 180These features are not yet fully implemented. 181