132900e82SRobert Watson.\"- 28a2d4f51SChris D. Faulhaber.\" Copyright (c) 1999-2001 Robert N. M. Watson 332900e82SRobert Watson.\" All rights reserved. 432900e82SRobert Watson.\" 532900e82SRobert Watson.\" Redistribution and use in source and binary forms, with or without 632900e82SRobert Watson.\" modification, are permitted provided that the following conditions 732900e82SRobert Watson.\" are met: 832900e82SRobert Watson.\" 1. Redistributions of source code must retain the above copyright 932900e82SRobert Watson.\" notice, this list of conditions and the following disclaimer. 1032900e82SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 1132900e82SRobert Watson.\" notice, this list of conditions and the following disclaimer in the 1232900e82SRobert Watson.\" documentation and/or other materials provided with the distribution. 1332900e82SRobert Watson.\" 1432900e82SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1532900e82SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1632900e82SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1732900e82SRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1832900e82SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1932900e82SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2032900e82SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2132900e82SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2232900e82SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2332900e82SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2432900e82SRobert Watson.\" SUCH DAMAGE. 2532900e82SRobert Watson.\" 2632900e82SRobert Watson.\" $FreeBSD$ 2732900e82SRobert Watson.\" 28a9315ddeSEdward Tomasz Napierala.Dd September 18, 2009 2932900e82SRobert Watson.Dt ACL 9 30aa12cea2SUlrich Spörlein.Os 3132900e82SRobert Watson.Sh NAME 3232900e82SRobert Watson.Nm acl 3332900e82SRobert Watson.Nd virtual file system access control lists 3432900e82SRobert Watson.Sh SYNOPSIS 3532eef9aeSRuslan Ermilov.In sys/param.h 3632eef9aeSRuslan Ermilov.In sys/vnode.h 3732eef9aeSRuslan Ermilov.In sys/acl.h 3832900e82SRobert Watson.Pp 39cae2a33cSChris CostelloIn the kernel configuration file: 40cae2a33cSChris Costello.Cd "options UFS_ACL" 41cae2a33cSChris Costello.Sh DESCRIPTION 42cae2a33cSChris CostelloAccess control lists, or ACLs, 43cae2a33cSChris Costelloallow fine-grained specification of rights 44cae2a33cSChris Costellofor vnodes representing files and directories. 45cae2a33cSChris CostelloHowever, as there are a plethora of file systems with differing ACL semantics, 46cae2a33cSChris Costellothe vnode interface is aware only of the syntax of ACLs, 47cae2a33cSChris Costellorelying on the underlying file system to implement the details. 48cae2a33cSChris CostelloDepending on the underlying file system, each file or directory 49cae2a33cSChris Costellomay have zero or more ACLs associated with it, named using the 50cae2a33cSChris Costello.Fa type 51cae2a33cSChris Costellofield of the appropriate vnode ACL calls: 52cae2a33cSChris Costello.Xr VOP_ACLCHECK 9 , 53cae2a33cSChris Costello.Xr VOP_GETACL 9 , 54cae2a33cSChris Costelloand 55cae2a33cSChris Costello.Xr VOP_SETACL 9 . 56cae2a33cSChris Costello.Pp 57cae2a33cSChris CostelloCurrently, each ACL is represented in-kernel by a fixed-size 58cae2a33cSChris Costello.Vt acl 59cae2a33cSChris Costellostructure, defined as follows: 60cae2a33cSChris Costello.Bd -literal -offset indent 61cae2a33cSChris Costellostruct acl { 623f8cd45fSEdward Tomasz Napierala unsigned int acl_maxcnt; 633f8cd45fSEdward Tomasz Napierala unsigned int acl_cnt; 643f8cd45fSEdward Tomasz Napierala int acl_spare[4]; 65cae2a33cSChris Costello struct acl_entry acl_entry[ACL_MAX_ENTRIES]; 6632900e82SRobert Watson}; 67cae2a33cSChris Costello.Ed 68cae2a33cSChris Costello.Pp 69cae2a33cSChris CostelloAn ACL is constructed from a fixed size array of ACL entries, 70cae2a33cSChris Costelloeach of which consists of a set of permissions, principal namespace, 71cae2a33cSChris Costelloand principal identifier. 723f8cd45fSEdward Tomasz NapieralaIn this implementation, the 733f8cd45fSEdward Tomasz Napierala.Vt acl_maxcnt 743f8cd45fSEdward Tomasz Napieralafield is always set to 753f8cd45fSEdward Tomasz Napierala.Dv ACL_MAX_ENTRIES . 76cae2a33cSChris Costello.Pp 77cae2a33cSChris CostelloEach individual ACL entry is of the type 78cae2a33cSChris Costello.Vt acl_entry_t , 79cae2a33cSChris Costellowhich is a structure with the following members: 803f640b03SRuslan Ermilov.Bl -tag -width 2n 81cae2a33cSChris Costello.It Vt acl_tag_t Va ae_tag 82cae2a33cSChris CostelloThe following is a list of definitions of ACL types 83cae2a33cSChris Costelloto be set in 84cae2a33cSChris Costello.Va ae_tag : 85cae2a33cSChris Costello.Pp 863f640b03SRuslan Ermilov.Bl -tag -width ".Dv ACL_UNDEFINED_FIELD" -offset indent -compact 87cae2a33cSChris Costello.It Dv ACL_UNDEFINED_FIELD 88cae2a33cSChris CostelloUndefined ACL type. 89cae2a33cSChris Costello.It Dv ACL_USER_OBJ 90cae2a33cSChris CostelloDiscretionary access rights for processes whose effective user ID 91cae2a33cSChris Costellomatches the user ID of the file's owner. 92cae2a33cSChris Costello.It Dv ACL_USER 93cae2a33cSChris CostelloDiscretionary access rights for processes whose effective user ID 94cae2a33cSChris Costellomatches the ACL entry qualifier. 95cae2a33cSChris Costello.It Dv ACL_GROUP_OBJ 96cae2a33cSChris CostelloDiscretionary access rights for processes whose effective group ID 97cae2a33cSChris Costelloor any supplemental groups 98cae2a33cSChris Costellomatch the group ID of the file's owner. 99cae2a33cSChris Costello.It Dv ACL_GROUP 100cae2a33cSChris CostelloDiscretionary access rights for processes whose effective group ID 101cae2a33cSChris Costelloor any supplemental groups 102cae2a33cSChris Costellomatch the ACL entry qualifier. 103cae2a33cSChris Costello.It Dv ACL_MASK 104cae2a33cSChris CostelloThe maximum discretionary access rights that can be granted 105cae2a33cSChris Costelloto a process in the file group class. 1063f8cd45fSEdward Tomasz NapieralaThis is only valid for POSIX.1e ACLs. 107cae2a33cSChris Costello.It Dv ACL_OTHER 108cae2a33cSChris CostelloDiscretionary access rights for processes not covered by any other ACL 109cae2a33cSChris Costelloentry. 1103f8cd45fSEdward Tomasz NapieralaThis is only valid for POSIX.1e ACLs. 111cae2a33cSChris Costello.It Dv ACL_OTHER_OBJ 112cae2a33cSChris CostelloSame as 113cae2a33cSChris Costello.Dv ACL_OTHER . 1143f8cd45fSEdward Tomasz Napierala.It Dv ACL_EVERYONE 1153f8cd45fSEdward Tomasz NapieralaDiscretionary access rights for all users. 1163f8cd45fSEdward Tomasz NapieralaThis is only valid for NFSv4 ACLs. 1173f8cd45fSEdward Tomasz Napierala.El 1183f8cd45fSEdward Tomasz Napierala.Pp 1193f8cd45fSEdward Tomasz NapieralaEach POSIX.1e ACL must contain exactly one 120cae2a33cSChris Costello.Dv ACL_USER_OBJ , 121cae2a33cSChris Costelloone 122cae2a33cSChris Costello.Dv ACL_GROUP_OBJ , 123cae2a33cSChris Costelloand one 124cae2a33cSChris Costello.Dv ACL_OTHER . 125cae2a33cSChris CostelloIf any of 126cae2a33cSChris Costello.Dv ACL_USER , 127cae2a33cSChris Costello.Dv ACL_GROUP , 128cae2a33cSChris Costelloor 129cae2a33cSChris Costello.Dv ACL_OTHER 130cae2a33cSChris Costelloare present, then exactly one 131cae2a33cSChris Costello.Dv ACL_MASK 132cae2a33cSChris Costelloentry should be present. 133cae2a33cSChris Costello.It Vt uid_t Va ae_id 134cae2a33cSChris CostelloThe ID of user for whom this ACL describes access permissions. 1353f8cd45fSEdward Tomasz NapieralaFor entries other than 1363f8cd45fSEdward Tomasz Napierala.Dv ACL_USER 1373f8cd45fSEdward Tomasz Napieralaand 1383f8cd45fSEdward Tomasz Napierala.Dv ACL_GROUP , 1393f8cd45fSEdward Tomasz Napieralathis field should be set to 1403f8cd45fSEdward Tomasz Napierala.Dv ACL_UNDEFINED_ID . 141cae2a33cSChris Costello.It Vt acl_perm_t Va ae_perm 142cae2a33cSChris CostelloThis field defines what kind of access the process matching this ACL has 143cae2a33cSChris Costellofor accessing the associated file. 1443f8cd45fSEdward Tomasz NapieralaFor POSIX.1e ACLs, the following are valid: 1453f8cd45fSEdward Tomasz Napierala.Bl -tag -width ".Dv ACL_WRITE_NAMED_ATTRS" 146cae2a33cSChris Costello.It Dv ACL_EXECUTE 147cae2a33cSChris CostelloThe process may execute the associated file. 148cae2a33cSChris Costello.It Dv ACL_WRITE 149cae2a33cSChris CostelloThe process may write to the associated file. 150cae2a33cSChris Costello.It Dv ACL_READ 151cae2a33cSChris CostelloThe process may read from the associated file. 152cae2a33cSChris Costello.It Dv ACL_PERM_NONE 153cae2a33cSChris CostelloThe process has no read, write or execute permissions 154cae2a33cSChris Costelloto the associated file. 155cae2a33cSChris Costello.El 1563f8cd45fSEdward Tomasz Napierala.Pp 1573f8cd45fSEdward Tomasz NapieralaFor NFSv4 ACLs, the following are valid: 1583f8cd45fSEdward Tomasz Napierala.Bl -tag -width ".Dv ACL_WRITE_NAMED_ATTRS" 1593f8cd45fSEdward Tomasz Napierala.It Dv ACL_READ_DATA 1603f8cd45fSEdward Tomasz NapieralaThe process may read from the associated file. 1613f8cd45fSEdward Tomasz Napierala.It Dv ACL_LIST_DIRECTORY 1623f8cd45fSEdward Tomasz NapieralaSame as 1633f8cd45fSEdward Tomasz Napierala.Dv ACL_READ_DATA . 1643f8cd45fSEdward Tomasz Napierala.It Dv ACL_WRITE_DATA 1653f8cd45fSEdward Tomasz NapieralaThe process may write to the associated file. 1663f8cd45fSEdward Tomasz Napierala.It Dv ACL_ADD_FILE 1673f8cd45fSEdward Tomasz NapieralaSame as 1683f8cd45fSEdward Tomasz Napierala.Dv ACL_ACL_WRITE_DATA . 1693f8cd45fSEdward Tomasz Napierala.It Dv ACL_APPEND_DATA 1703f8cd45fSEdward Tomasz Napierala.It Dv ACL_ADD_SUBDIRECTORY 1713f8cd45fSEdward Tomasz NapieralaSame as 1723f8cd45fSEdward Tomasz Napierala.Dv ACL_APPEND_DATA . 1733f8cd45fSEdward Tomasz Napierala.It Dv ACL_READ_NAMED_ATTRS 1743f8cd45fSEdward Tomasz NapieralaIgnored. 1753f8cd45fSEdward Tomasz Napierala.It Dv ACL_WRITE_NAMED_ATTRS 1763f8cd45fSEdward Tomasz NapieralaIgnored. 1773f8cd45fSEdward Tomasz Napierala.It Dv ACL_EXECUTE 1783f8cd45fSEdward Tomasz NapieralaThe process may execute the associated file. 1793f8cd45fSEdward Tomasz Napierala.It Dv ACL_DELETE_CHILD 1803f8cd45fSEdward Tomasz Napierala.It Dv ACL_READ_ATTRIBUTES 1813f8cd45fSEdward Tomasz Napierala.It Dv ACL_WRITE_ATTRIBUTES 1823f8cd45fSEdward Tomasz Napierala.It Dv ACL_DELETE 1833f8cd45fSEdward Tomasz Napierala.It Dv ACL_READ_ACL 1843f8cd45fSEdward Tomasz Napierala.It Dv ACL_WRITE_ACL 1853f8cd45fSEdward Tomasz Napierala.It Dv ACL_WRITE_OWNER 1863f8cd45fSEdward Tomasz Napierala.It Dv ACL_SYNCHRONIZE 1873f8cd45fSEdward Tomasz NapieralaIgnored. 1883f8cd45fSEdward Tomasz Napierala.El 1893f8cd45fSEdward Tomasz Napierala.It Vt acl_entry_type_t Va ae_entry_type 1903f8cd45fSEdward Tomasz NapieralaThis field defines the type of NFSv4 ACL entry. 1913f8cd45fSEdward Tomasz NapieralaIt is not used with POSIX.1e ACLs. 1923f8cd45fSEdward Tomasz NapieralaThe following values are valid: 1933f8cd45fSEdward Tomasz Napierala.Bl -tag -width ".Dv ACL_WRITE_NAMED_ATTRS" 1943f8cd45fSEdward Tomasz Napierala.It Dv ACL_ENTRY_TYPE_ALLOW 1953f8cd45fSEdward Tomasz Napierala.It Dv ACL_ENTRY_TYPE_DENY 1963f8cd45fSEdward Tomasz Napierala.El 1973f8cd45fSEdward Tomasz Napierala.It Vt acl_flag_t Va ae_flags 1983f8cd45fSEdward Tomasz NapieralaThis field defines the inheritance flags of NFSv4 ACL entry. 1993f8cd45fSEdward Tomasz NapieralaIt is not used with POSIX.1e ACLs. 2003f8cd45fSEdward Tomasz NapieralaThe following values are valid: 2013f8cd45fSEdward Tomasz Napierala.Bl -tag -width ".Dv ACL_ENTRY_DIRECTORY_INHERIT" 2023f8cd45fSEdward Tomasz Napierala.It Dv ACL_ENTRY_FILE_INHERIT 2033f8cd45fSEdward Tomasz Napierala.It Dv ACL_ENTRY_DIRECTORY_INHERIT 2044a486705SEdward Tomasz Napierala.It Dv ACL_ENTRY_NO_PROPAGATE_INHERIT 2053f8cd45fSEdward Tomasz Napierala.It Dv ACL_ENTRY_INHERIT_ONLY 2063f8cd45fSEdward Tomasz Napierala.El 207cae2a33cSChris Costello.El 20832900e82SRobert Watson.Sh SEE ALSO 20967ea1c24SChris Costello.Xr acl 3 , 210*1e9469d1SChristian Brueffer.Xr vaccess 9 , 211a9315ddeSEdward Tomasz Napierala.Xr vaccess_acl_nfs4 9 , 21267ea1c24SChris Costello.Xr vaccess_acl_posix1e 9 , 21332900e82SRobert Watson.Xr VFS 9 , 21432900e82SRobert Watson.Xr VOP_ACLCHECK 9 , 21532900e82SRobert Watson.Xr VOP_GETACL 9 , 2166fe89339SBen Smithurst.Xr VOP_SETACL 9 21732900e82SRobert Watson.Sh AUTHORS 218571dba6eSHiten PandyaThis manual page was written by 21932900e82SRobert Watson.An Robert Watson . 220