1.\"- 2.\" Copyright (c) 2000, 2001 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 31.Sh NAME 32.Nm acl 33.Nd introduction to the POSIX.1e ACL security API 34.Sh LIBRARY 35.Lb libc 36.Sh SYNOPSIS 37.In sys/types.h 38.In sys/acl.h 39.Sh DESCRIPTION 40.Fx 41permits file systems to export Access Control Lists via the VFS, and 42provides a library for userland access to and manipulation of these ACLs. 43Not all file systems provide support for ACLs, and some may require that 44ACL support be explicitely enabled by the administrator. 45The library calls include routines to allocate, duplicate, retrieve, set, 46and validate ACLs associated with file objects. 47As well as the POSIX.1e routines, there are a number of non-portable 48extensions defined that allow for alternative ACL semantics than the 49POSIX.1e semantics, such as AFS, NTFS, Coda, and NWFS semantics. 50Where routines are non-standard, they are suffixed with _np to indicate that 51they are not portable. 52.Pp 53POSIX.1e describes a set of ACL manipulation routines to manage the 54contents of ACLs, as well as their relationships with files; almost 55all of these support routines are implemented in 56.Fx . 57.Pp 58Available functions, sorted by behavior, include: 59.Bl -tag -width indent 60.It Fn acl_add_perm 61This function is described in 62.Xr acl_add_perm 3 , 63and may be used to add permissions to a permission set. 64.It Fn acl_calc_mask 65This function is described in 66.Xr acl_calc_mask 3 , 67and may be used to calculate and set the permissions associated with 68the 69.Dv ACL_MASK 70entry. 71.It Fn acl_clear_perms 72This function is described in 73.Xr acl_clear_perms 3 , 74and may be used to clear all permissions from a permission set. 75.It Fn acl_copy_entry 76This function is described in 77.Xr acl_copy_entry 3 , 78and may be used to copy the contents of an ACL entry. 79.It Fn acl_create_entry 80This function is described in 81.Xr acl_create_entry 3 , 82and may be used to create an empty entry in an ACL. 83.It Xo 84.Fn acl_delete_def_file , 85.Fn acl_delete_file_np , 86.Fn acl_delete_fd_np 87.Xc 88These functions are described in 89.Xr acl_delete 3 , 90and may be used to delete ACLs from file system objects. 91.It Fn acl_delete_entry 92This function is described in 93.Xr acl_delete_entry 3 , 94and may be used to delete an entry from an ACL. 95.It Fn acl_delete_perm 96This function is described in 97.Xr acl_delete_perm 3 , 98and may be used to delete permissions from a permset. 99.It Fn acl_dup 100This function is described in 101.Xr acl_dup 3 , 102and may be used to duplicate an ACL structure. 103.It Fn acl_free 104This function is described in 105.Xr acl_free 3 , 106and may be used to free userland working ACL storage. 107.It Fn acl_from_text 108This function is described in 109.Xr acl_from_text 3 , 110and may be used to convert a text-form ACL into working ACL state, if 111the ACL has POSIX.1e semantics. 112.It Fn acl_get_entry 113This function is described in 114.Xr acl_get_entry 3 , 115and may be used to retrieve a designated ACL entry from an ACL. 116.It Xo 117.Fn acl_get_file , 118.Fn acl_get_fd , 119.Fn acl_get_fd_np 120.Xc 121These functions are described in 122.Xr acl_get 3 , 123and may be used to retrieve ACLs from file system objects. 124.It Fn acl_get_permset 125This function is described in 126.Xr acl_get_permset 3 , 127and may be used to retrieve a permset from an ACL entry. 128.It Fn acl_get_qualifier 129This function is described in 130.Xr acl_get_qualifier 3 , 131and may be used to retrieve the qualifier from an ACL entry. 132.It Fn acl_get_tag_type 133This function is described in 134.Xr acl_get_tag_type 3 , 135and may be used to retrieve the tag type from an ACL entry. 136.It Fn acl_init 137This function is described in 138.Xr acl_init 3 , 139and may be used to allocate a fresh (empty) ACL structure. 140.It Xo 141.Fn acl_set_file , 142.Fn acl_set_fd , 143.Fn acl_set_fd_np 144.Xc 145These functions are described in 146.Xr acl_set 3 , 147and may be used to assign an ACL to a file system object. 148.It Fn acl_set_permset 149This function is described in 150.Xr acl_set_permset 3 , 151and may be used to set the permissions of an ACL entry from a permset. 152.It Fn acl_set_qualifier 153This function is described in 154.Xr acl_set_qualifier 3 , 155and may be used to set the qualifier of an ACL. 156.It Fn acl_set_tag_type 157This function is described in 158.Xr acl_set_tag_type 3 , 159and may be used to set the tag type of an ACL. 160.It Fn acl_to_text 161This function is described in 162.Xr acl_to_text 3 , 163and may be used to generate a text-form of a POSIX.1e semantics ACL. 164.It Xo 165.Fn acl_valid , 166.Fn acl_valid_file_np , 167.Fn acl_valid_fd_np 168.Xc 169These functions are described in 170.Xr acl_valid 3 , 171and may be used to validate an ACL as correct POSIX.1e-semantics, or 172as appropriate for a particular file system object regardless of semantics. 173.El 174.Pp 175Documentation of the internal kernel interfaces backing these calls may 176be found in 177.Xr acl 9 . 178The syscalls between the internal interfaces and the public library 179routines may change over time, and as such are not documented. 180They are not intended to be called directly without going through the 181library. 182.Sh IMPLEMENTATION NOTES 183.Fx Ns 's 184support for POSIX.1e interfaces and features is still under 185development at this time. 186.Sh SEE ALSO 187.Xr acl_add_perm 3 , 188.Xr acl_calc_mask 3 , 189.Xr acl_clear_perms 3 , 190.Xr acl_copy_entry 3 , 191.Xr acl_create_entry 3 , 192.Xr acl_delete_entry 3 , 193.Xr acl_delete_perm 3 , 194.Xr acl_dup 3 , 195.Xr acl_free 3 , 196.Xr acl_from_text 3 , 197.Xr acl_get 3 , 198.Xr acl_get_permset 3 , 199.Xr acl_get_qualifier 3 , 200.Xr acl_get_tag_type 3 , 201.Xr acl_init 3 , 202.Xr acl_set 3 , 203.Xr acl_set_permset 3 , 204.Xr acl_set_qualifier 3 , 205.Xr acl_set_tag_type 3 , 206.Xr acl_to_text 3 , 207.Xr acl_valid 3 , 208.Xr posix1e 3 , 209.Xr acl 9 210.Sh STANDARDS 211POSIX.1e assigns security labels to all objects, extending the security 212functionality described in POSIX.1. 213These additional labels provide fine-grained discretionary access control, 214fine-grained capabilities, and labels necessary for mandatory access 215control. 216POSIX.2c describes a set of userland utilities for manipulating these 217labels. 218.Pp 219POSIX.1e is described in IEEE POSIX.1e draft 17. 220Discussion of the draft continues on the cross-platform POSIX.1e 221implementation mailing list. 222To join this list, see the 223.Fx 224POSIX.1e implementation page for more information. 225.Sh HISTORY 226POSIX.1e support was introduced in 227.Fx 4.0 ; 228.Fx 5.0 229was the first version to include a complete ACL implementation based 230on extended attributes. 231.Sh AUTHORS 232.An Robert N M Watson 233