acl
- introduction to the POSIX.1e ACL security API
LIBRARY
Lb libc
SYNOPSIS
#include <sys/types.h>
#include <sys/acl.h>
DESCRIPTION
Fx permits file systems to export Access Control Lists via the VFS, and
provides a library for userland access to and manipulation of these ACLs.
Not all file systems provide support for ACLs, and some may require that
ACL support be explicitly enabled by the administrator.
The library calls include routines to allocate, duplicate, retrieve, set,
and validate ACLs associated with file objects.
As well as the POSIX.1e routines, there are a number of non-portable
extensions defined that allow for alternative ACL semantics than the
POSIX.1e semantics, such as AFS, NTFS, Coda, and NWFS semantics.
Where routines are non-standard, they are suffixed with _np to indicate that
they are not portable.
POSIX.1e describes a set of ACL manipulation routines to manage the
contents of ACLs, as well as their relationships with files; almost
all of these support routines are implemented in
Fx .
Available functions, sorted by behavior, include:
Fn acl_add_perm
This function is described in
acl_add_perm3,
and may be used to add permissions to a permission set.
Fn acl_calc_mask
This function is described in
acl_calc_mask3,
and may be used to calculate and set the permissions associated with
the
ACL_MASK
entry.
Fn acl_clear_perms
This function is described in
acl_clear_perms3,
and may be used to clear all permissions from a permission set.
Fn acl_copy_entry
This function is described in
acl_copy_entry3,
and may be used to copy the contents of an ACL entry.
Fn acl_create_entry
This function is described in
acl_create_entry3,
and may be used to create an empty entry in an ACL.
These functions are described in
acl_valid3,
and may be used to validate an ACL as correct POSIX.1e-semantics, or
as appropriate for a particular file system object regardless of semantics.
Documentation of the internal kernel interfaces backing these calls may
be found in
acl(9).
The syscalls between the internal interfaces and the public library
routines may change over time, and as such are not documented.
They are not intended to be called directly without going through the
library.
POSIX.1e assigns security labels to all objects, extending the security
functionality described in POSIX.1.
These additional labels provide fine-grained discretionary access control,
fine-grained capabilities, and labels necessary for mandatory access
control.
POSIX.2c describes a set of userland utilities for manipulating these
labels.
POSIX.1e is described in IEEE POSIX.1e draft 17.
Discussion of the draft continues on the cross-platform POSIX.1e
implementation mailing list.
To join this list, see the
Fx POSIX.1e implementation page for more information.
HISTORY
POSIX.1e support was introduced in
Fx 4.0 ;
Fx 5.0
was the first version to include a complete ACL implementation based
on extended attributes for the UFS and UFS2 file systems.
The
getfacl(1)
and
setfacl(1)
utilities describe the user tools that permit direct manipulation of complete
file ACLs.