1a889d1fbSRobert Watson.\"- 2a21c3aa0SRobert Watson.\" Copyright (c) 2000, 2001 Robert N. M. Watson 3a889d1fbSRobert Watson.\" All rights reserved. 4a889d1fbSRobert Watson.\" 5a889d1fbSRobert Watson.\" Redistribution and use in source and binary forms, with or without 6a889d1fbSRobert Watson.\" modification, are permitted provided that the following conditions 7a889d1fbSRobert Watson.\" are met: 8a889d1fbSRobert Watson.\" 1. Redistributions of source code must retain the above copyright 9a889d1fbSRobert Watson.\" notice, this list of conditions and the following disclaimer. 10a889d1fbSRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 11a889d1fbSRobert Watson.\" notice, this list of conditions and the following disclaimer in the 12a889d1fbSRobert Watson.\" documentation and/or other materials provided with the distribution. 13a889d1fbSRobert Watson.\" 14a889d1fbSRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15a889d1fbSRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16a889d1fbSRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17a889d1fbSRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18a889d1fbSRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19a889d1fbSRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20a889d1fbSRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21a889d1fbSRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22a889d1fbSRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23a889d1fbSRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24a889d1fbSRobert Watson.\" SUCH DAMAGE. 25a889d1fbSRobert Watson.\" 26a889d1fbSRobert Watson.\" $FreeBSD$ 27a889d1fbSRobert Watson.\" 28a889d1fbSRobert Watson.Dd January 28, 2000 29a889d1fbSRobert Watson.Dt ACL 3 30ed403116SRuslan Ermilov.Os FreeBSD 31a889d1fbSRobert Watson.Sh NAME 32c32381adSMike Pritchard.Nm acl 33c32381adSMike Pritchard.Nd introduction to the POSIX.1e ACL security API 34f75b050cSAlexey Zelkin.Sh LIBRARY 35f75b050cSAlexey Zelkin.Lb libposix1e 36a889d1fbSRobert Watson.Sh SYNOPSIS 37a889d1fbSRobert Watson.Fd #include <sys/types.h> 38a889d1fbSRobert Watson.Fd #include <sys/acl.h> 39a889d1fbSRobert Watson.Sh DESCRIPTION 40a21c3aa0SRobert Watson.Fx 41a21c3aa0SRobert Watsonpermits file systems to export Access Control Lists via the VFS, and 42a21c3aa0SRobert Watsonprovides a library for userland access to and manipulation of these ACLs. 43a21c3aa0SRobert WatsonNot all file systems provide support for ACLs, and some may require that 44a21c3aa0SRobert WatsonACL support be explicitely enabled by the administrator. 45a21c3aa0SRobert WatsonThe library calls include routines to allocate, duplicate, retrieve, set, 46a21c3aa0SRobert Watsonand validate ACLs associated with file objects. 47a889d1fbSRobert WatsonAs well as the POSIX.1e routines, there are a number of non-portable 48a889d1fbSRobert Watsonextensions defined that allow for alternative ACL semantics than the 49a21c3aa0SRobert WatsonPOSIX.1e semantics, such as AFS, NTFS, Coda, and NWFS semantics. 50a21c3aa0SRobert WatsonWhere routines are non-standard, they are suffixed with _np to indicate that 51a889d1fbSRobert Watsonthey are not portable. 5242635956SRuslan Ermilov.Pp 53a889d1fbSRobert WatsonPOSIX.1e describes a set of ACL manipulation routines to manage the 54a21c3aa0SRobert Watsoncontents of ACLs, as well as their relationships with files; almost 55a21c3aa0SRobert Watsonall of these support routines are implemented in 56a21c3aa0SRobert Watson.Fx . 5742635956SRuslan Ermilov.Pp 58a889d1fbSRobert WatsonAvailable functions, sorted by behavior, include: 5942635956SRuslan Ermilov.Pp 60a889d1fbSRobert Watson.Fn acl_delete_def_file , 61a889d1fbSRobert Watson.Fn acl_delete_file_np , 62a889d1fbSRobert Watson.Fn acl_delete_fd_np 6342635956SRuslan Ermilov.Pp 64a889d1fbSRobert WatsonThese functions are described in 65a889d1fbSRobert Watson.Xr acl_delete 3 , 66a889d1fbSRobert Watsonand may be used to delete ACLs from file system objects. 6742635956SRuslan Ermilov.Pp 68a889d1fbSRobert Watson.Fn acl_free 6942635956SRuslan Ermilov.Pp 70a889d1fbSRobert WatsonThis function is described in 71a889d1fbSRobert Watson.Xr acl_free 3 , 72a889d1fbSRobert Watsonand may be used to free userland working ACL storage. 7342635956SRuslan Ermilov.Pp 74a889d1fbSRobert Watson.Fn acl_from_text 7542635956SRuslan Ermilov.Pp 76a889d1fbSRobert WatsonThis function is described in 77a889d1fbSRobert Watson.Xr acl_from_text 3 , 78a889d1fbSRobert Watsonand may be used to convert a text-form ACL into working ACL state, if 79a889d1fbSRobert Watsonthe ACL has POSIX.1e semantics. 8042635956SRuslan Ermilov.Pp 81a889d1fbSRobert Watson.Fn acl_get_file , 82a889d1fbSRobert Watson.Fn acl_get_fd , 83a889d1fbSRobert Watson.Fn acl_get_fd_np 8442635956SRuslan Ermilov.Pp 85a889d1fbSRobert WatsonThese functions are described in 86a889d1fbSRobert Watson.Xr acl_get 3 , 87a889d1fbSRobert Watsonand may be used to retrieve ACLs from file system objects. 8842635956SRuslan Ermilov.Pp 89a889d1fbSRobert Watson.Fn acl_init 9042635956SRuslan Ermilov.Pp 91a889d1fbSRobert WatsonThis function is described in 92a889d1fbSRobert Watson.Xr acl_init 3 , 93a889d1fbSRobert Watsonand may be used to allocate a fresh (empty) ACL structure. 9442635956SRuslan Ermilov.Pp 95a889d1fbSRobert Watson.Fn acl_dup 9642635956SRuslan Ermilov.Pp 97a889d1fbSRobert WatsonThis function is described in 98a889d1fbSRobert Watson.Xr acl_dup 3 , 99a889d1fbSRobert Watsonand may be used to duplicate an ACL structure. 10042635956SRuslan Ermilov.Pp 101a889d1fbSRobert Watson.Fn acl_set_file , 102a889d1fbSRobert Watson.Fn acl_set_fd , 103a889d1fbSRobert Watson.Fn acl_set_fd_np 10442635956SRuslan Ermilov.Pp 105c32381adSMike PritchardThese functions are described in 106a889d1fbSRobert Watson.Xr acl_set 3 , 107a889d1fbSRobert Watsonand may be used to assign an ACL to a file system object. 10842635956SRuslan Ermilov.Pp 109a889d1fbSRobert Watson.Fn acl_to_text 11042635956SRuslan Ermilov.Pp 111a889d1fbSRobert WatsonThis function is described in 112a889d1fbSRobert Watson.Xr acl_to_text 3 , 113a889d1fbSRobert Watsonand may be used to generate a text-form of a POSIX.1e semantics ACL. 11442635956SRuslan Ermilov.Pp 115a889d1fbSRobert Watson.Fn acl_valid , 116a889d1fbSRobert Watson.Fn acl_valid_file_np , 117a889d1fbSRobert Watson.Fn acl_valid_fd_np 11842635956SRuslan Ermilov.Pp 119a889d1fbSRobert WatsonThee functions are described in 120a889d1fbSRobert Watson.Xr acl_valid 3 , 121a889d1fbSRobert Watsonand may be used to validate an ACL as correct POSIX.1e-semantics, or 122a889d1fbSRobert Watsonas appropriate for a particular file system object regardless of semantics. 12342635956SRuslan Ermilov.Pp 124a889d1fbSRobert WatsonDocumentation of the internal kernel interfaces backing these calls may 125a889d1fbSRobert Watsonbe found in 126a889d1fbSRobert Watson.Xr acl 9 . 127a889d1fbSRobert WatsonThe syscalls between the internal interfaces and the public library 128a21c3aa0SRobert Watsonroutines may change over time, and as such are not documented. 129a21c3aa0SRobert WatsonThey are not intended to be called directly without going through the 130a21c3aa0SRobert Watsonlibrary. 131a889d1fbSRobert Watson.Sh IMPLEMENTATION NOTES 132b5c508fbSRuslan Ermilov.Fx Ns 's 133b5c508fbSRuslan Ermilovsupport for POSIX.1e interfaces and features is still under 134a889d1fbSRobert Watsondevelopment at this time. 135a889d1fbSRobert Watson.Sh ENVIRONMENT 136a889d1fbSRobert WatsonPOSIX.1e assigns security labels to all objects, extending the security 137a21c3aa0SRobert Watsonfunctionality described in POSIX.1. 138a21c3aa0SRobert WatsonThese additional labels provide fine-grained discretionary access control, 139a21c3aa0SRobert Watsonfine-grained capabilities, and labels necessary for mandatory access 140a21c3aa0SRobert Watsoncontrol. 141a21c3aa0SRobert WatsonPOSIX.2c describes a set of userland utilities for manipulating these 142a21c3aa0SRobert Watsonlabels. 143c32381adSMike Pritchard.\" .Sh FILES 144a889d1fbSRobert Watson.Sh SEE ALSO 145a889d1fbSRobert Watson.Xr acl_dup 3 , 146a889d1fbSRobert Watson.Xr acl_free 3 , 147a889d1fbSRobert Watson.Xr acl_from_text 3 , 148a889d1fbSRobert Watson.Xr acl_get 3 , 149a889d1fbSRobert Watson.Xr acl_set 3 , 150a889d1fbSRobert Watson.Xr acl_to_text 3 , 151a889d1fbSRobert Watson.Xr acl_valid 3 , 152db0e6ab2SRobert Watson.Xr acl 9 , 153db0e6ab2SRobert Watson.Xr posix1e 3 154a889d1fbSRobert Watson.Sh STANDARDS 155a21c3aa0SRobert WatsonPOSIX.1e is described in IEEE POSIX.1e draft 17. 156a21c3aa0SRobert WatsonDiscussion of the draft continues on the cross-platform POSIX.1e 157a21c3aa0SRobert Watsonimplementation mailing list. 158a21c3aa0SRobert WatsonTo join this list, see the 159c32381adSMike Pritchard.Fx 160a21c3aa0SRobert WatsonPOSIX.1e implementation page for more information. 161a889d1fbSRobert Watson.Sh HISTORY 162c32381adSMike PritchardPOSIX.1e support was introduced in 163a21c3aa0SRobert Watson.Fx 4.0 ; 164a21c3aa0SRobert Watson.Fx 5.0 165a21c3aa0SRobert Watsonwas the first version to include a complete ACL implementation based 166a21c3aa0SRobert Watsonon extended attributes. 167a889d1fbSRobert Watson.Sh AUTHORS 168c32381adSMike Pritchard.An Robert N M Watson 169