ACL(9)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 NAME 🌸

acl β€” virtual file system access control lists. This is the ACL(9) page from the Kernel Developer's Manual, section 9, so bestie we are deep in kernel land. πŸ’…


✨ SYNOPSIS ✨

Okay so first you include these:

#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/acl.h>

In the kernel configuration file:
options UFS_ACL

πŸ¦‹ DESCRIPTION πŸ¦‹

Access control lists β€” ACLs β€” let you specify rights for vnodes representing files and directories in a fine-grained way. But here's the plot twist: there are a plethora of file systems with differing ACL semantics, so the vnode interface is aware only of the syntax of ACLs. It relies 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 type field of the appropriate vnode ACL calls: VOP_ACLCHECK(9), VOP_GETACL(9), and VOP_SETACL(9).

Currently, each ACL is represented in-kernel by a fixed-size acl structure, defined as follows:

      struct acl {
              unsigned int            acl_maxcnt;
              unsigned int            acl_cnt;
              int                     acl_spare[4];
              struct acl_entry        acl_entry[ACL_MAX_ENTRIES];
      };

An ACL is constructed from a fixed size array of ACL entries, and each entry consists of a set of permissions, principal namespace, and principal identifier. In this implementation, the acl_maxcnt field is always set to ACL_MAX_ENTRIES.

Each individual ACL entry is of the type acl_entry_t, which is a structure with the following members:

🏷️ 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. This is only valid for POSIX.1e ACLs.
  • ACL_OTHER β€” Discretionary access rights for processes not covered by any other ACL entry. This is only valid for POSIX.1e ACLs.
  • ACL_OTHER_OBJ β€” Same as ACL_OTHER.
  • ACL_EVERYONE β€” Discretionary access rights for all users. This is only valid for NFSv4 ACLs.
⚠️ Each POSIX.1e ACL must contain exactly one ACL_USER_OBJ, one ACL_GROUP_OBJ, and one ACL_OTHER. If any of ACL_USER, ACL_GROUP, or ACL_OTHER are present, then exactly one ACL_MASK entry should be present. No cap, that's the rule. ✨

πŸ†” uid_t ae_id

The ID of user for whom this ACL describes access permissions. For entries other than ACL_USER and ACL_GROUP, this field should be set to ACL_UNDEFINED_ID.

πŸ” acl_perm_t ae_perm

This field defines what kind of access the process matching this ACL has for accessing the associated file.

For POSIX.1e ACLs, the following are valid:

  • 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.

For NFSv4 ACLs, the following are valid:

  • ACL_READ_DATA β€” The process may read from the associated file.
  • ACL_LIST_DIRECTORY β€” Same as ACL_READ_DATA.
  • ACL_WRITE_DATA β€” The process may write to the associated file.
  • ACL_ADD_FILE β€” Same as ACL_ACL_WRITE_DATA.
  • ACL_APPEND_DATA β€” no extra description on the page, just the flag itself.
  • ACL_ADD_SUBDIRECTORY β€” Same as ACL_APPEND_DATA.
  • ACL_READ_NAMED_ATTRS β€” Ignored.
  • ACL_WRITE_NAMED_ATTRS β€” Ignored.
  • ACL_EXECUTE β€” The process may execute the associated file.
  • ACL_DELETE_CHILD β€” no extra description on the page, just the flag itself.
  • ACL_READ_ATTRIBUTES β€” no extra description on the page, just the flag itself.
  • ACL_WRITE_ATTRIBUTES β€” no extra description on the page, just the flag itself.
  • ACL_DELETE β€” no extra description on the page, just the flag itself.
  • ACL_READ_ACL β€” no extra description on the page, just the flag itself.
  • ACL_WRITE_ACL β€” no extra description on the page, just the flag itself.
  • ACL_WRITE_OWNER β€” no extra description on the page, just the flag itself.
  • ACL_SYNCHRONIZE β€” Ignored.

🎚️ acl_entry_type_t ae_entry_type

This field defines the type of NFSv4 ACL entry. It is not used with POSIX.1e ACLs. The following values are valid:

  • ACL_ENTRY_TYPE_ALLOW β€” listed with no extra description.
  • ACL_ENTRY_TYPE_DENY β€” listed with no extra description.

🚩 acl_flag_t ae_flags

This field defines the inheritance flags of NFSv4 ACL entry. It is not used with POSIX.1e ACLs. The following values are valid:

  • ACL_ENTRY_FILE_INHERIT β€” listed with no extra description.
  • ACL_ENTRY_DIRECTORY_INHERIT β€” listed with no extra description.
  • ACL_ENTRY_NO_PROPAGATE_INHERIT β€” listed with no extra description.
  • ACL_ENTRY_INHERIT_ONLY β€” listed with no extra description.
  • ACL_ENTRY_INHERITED β€” The ACL_ENTRY_INHERITED flag is set on an ACE that has been inherited from its parent. It may also be set programmatically, and is valid on both files and directories.

πŸ’– SEE ALSO πŸ’–


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Robert Watson. Iconic behavior, honestly. 🫢


Source/version: Debian; date: September 4, 2015 β€” mwah, thanks for reading bestie! πŸ’‹πŸŽ€

πŸ“¦ where this page comes from