Access control lists, or ACLs,
allow fine-grained specification of rights
for vnodes representing files and directories.
However, as there are a plethora of file systems with differing ACL semantics,
the vnode interface is aware only of the syntax of ACLs,
relying on the underlying file system to implement the details.
Depending on the underlying file system, each file or directory
may have zero or more ACLs associated with it, named using the
Fa type
field of the appropriate vnode ACL calls:
VOP_ACLCHECK9,
VOP_GETACL9,
and
VOP_SETACL9.
Currently, each ACL is represented in-kernel by a fixed-size
Vt acl
structure, defined as follows:
struct acl {
int acl_cnt;
struct acl_entry acl_entry[ACL_MAX_ENTRIES];
};
An ACL is constructed from a fixed size array of ACL entries,
each of which consists of a set of permissions, principal namespace,
and principal identifier.
Each individual ACL entry is of the type
Vt acl_entry_t ,
which is a structure with the following members:
Vt acl_tag_t ae_tag
The following is a list of definitions of ACL types
to be set in
ae_tag
ACL_UNDEFINED_FIELD
Undefined ACL type.
ACL_USER_OBJ
Discretionary access rights for processes whose effective user ID
matches the user ID of the file's owner.
ACL_USER
Discretionary access rights for processes whose effective user ID
matches the ACL entry qualifier.
ACL_GROUP_OBJ
Discretionary access rights for processes whose effective group ID
or any supplemental groups
match the group ID of the file's owner.
ACL_GROUP
Discretionary access rights for processes whose effective group ID
or any supplemental groups
match the ACL entry qualifier.
ACL_MASK
The maximum discretionary access rights that can be granted
to a process in the file group class.
ACL_OTHER
Discretionary access rights for processes not covered by any other ACL
entry.
ACL_OTHER_OBJ
Same as
ACL_OTHER
Each ACL entry must contain exactly one
ACL_USER_OBJ
one
ACL_GROUP_OBJ
and one
ACL_OTHER
If any of
ACL_USERACL_GROUP
or
ACL_OTHER
are present, then exactly one
ACL_MASK
entry should be present.
Vt uid_t ae_id
The ID of user for whom this ACL describes access permissions.
Vt acl_perm_t ae_perm
This field defines what kind of access the process matching this ACL has
for accessing the associated file.
ACL_EXECUTE
The process may execute the associated file.
ACL_WRITE
The process may write to the associated file.
ACL_READ
The process may read from the associated file.
ACL_PERM_NONE
The process has no read, write or execute permissions
to the associated file.