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