VACCESS_ACL_POSIX1E(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… VACCESS_ACL_POSIX1E(9) β€” the kernel dev manual, bestie edition πŸŽ€

okay so real talk, this page lives in the Kernel Developer's Manual (section 9, kernel-land, adults only ✨), and it's about vaccess_acl_posix1e β€” literally the function that decides whether you're allowed to touch a file, but make it POSIX.1e ACL flavored. let's get into it πŸ¦‹


✨ NAME ✨

vaccess_acl_posix1e β€” generate a POSIX.1e ACL access control decision using vnode parameters πŸ’…


🌸 SYNOPSIS 🌸

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

int
vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid,
    struct acl *acl, accmode_t accmode, struct ucred *cred,
    int *privused);

like, copy that exactly, bestie, those headers are #include <sys/param.h>, #include <sys/vnode.h> and #include <sys/acl.h> and every single one of them matters 🫢


πŸ”₯ DESCRIPTION πŸ”₯

This call implements the logic for the Unix discretionary file security model with POSIX.1e ACL extensions. no cap, that's the whole vibe check.

So it takes all these parameters and honestly the way it just accepts them all? iconic:

  • the vnode's type, type
  • owning UID, file_uid
  • owning GID, file_gid
  • the access ACL for the file, acl
  • the desired access mode, accmode
  • the requesting credential, cred
  • and an optional call-by-reference int pointer, privused, which returns whether or not privilege was required for a successful evaluation of the call πŸ”‘

about that privused pointer specifically β€” the caller can set it to NULL if they simply don't want to be informed of privilege information 😌, or it can point to an int that will be set to 1 if privilege is used, and 0 otherwise. very demure, very mindful.

This call is intended to support implementations of VOP_ACCESS(9), which will use their own access methods to retrieve the vnode properties, and then invoke vaccess_acl_posix1e() in order to perform the actual check. and here's the tea β€” implementations of VOP_ACCESS(9) may choose to implement additional security mechanisms whose results will be composed with the return value. so it's a team effort, periodt.

The algorithm used by vaccess_acl_posix1e() is based on the POSIX.1e ACL evaluation algorithm. it selects a matching entry from the access ACL, which may then be composed with an available ACL mask entry, providing Unix security compatibility. it's giving layered. it's giving elegant. πŸ’–

Once appropriate protections are selected for the current credential, the requested access mode, in combination with the vnode type, will be compared with the discretionary rights available for the credential. and if the rights granted by discretionary protections are insufficient?? then super-user privilege β€” if available for the credential β€” will also be considered. main character privilege energy honestly πŸ‘‘


🌈 RETURN VALUES 🌈

  • vaccess_acl_posix1e() will return 0 on success
  • or a non-zero error value on failure 😭

that's it. that's the whole section. slay for brevity.


πŸ’€ ERRORS πŸ’€

  • [EACCES] β€” Permission denied. An attempt was made to access a file in a way forbidden by its file access permissions. (the classic "you shall not pass" moment πŸ™ˆ)
  • [EPERM] β€” Operation not permitted. An attempt was made to perform an operation limited to processes with appropriate privileges or to the owner of a file or other resource. (like, who do you think you ARE πŸ’…)

πŸ¦‹ SEE ALSO πŸ¦‹

go read all three, i'm literally begging you 🫢


πŸ‘‘ AUTHORS πŸ‘‘

This manual page and the current implementation of vaccess_acl_posix1e() were written by Robert Watson. thank you king, the kernel community owes you everything ⭐


πŸ“ BUGS πŸ“

This manual page should include a full description of the POSIX.1e ACL evaluation algorithm, or cross reference another page that does. so like... it doesn't. yet. noted, bestie 😭


and that's the whole page! this one came from the Debian source tree and it's dated August 22, 2001 β€” yes, it's older than most of us on this app, and it still ate πŸ’…βœ¨

πŸ“¦ where this page comes from