VOP_SETACL(9)

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

πŸ’… VOP_SETACL πŸ’…

okay so bestie, welcome to the VOP_SETACL(9) page β€” the one that's all about setting the access control list (ACL) for a vnode. it's a kernel developer manual, but we're gonna make it make sense, fr fr πŸ’–


✨ NAME ✨

VOP_SETACL β€” set the access control list for a vnode. yup, that's the whole vibe.


🌸 SYNOPSIS 🌸

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

int
VOP_SETACL(struct vnode *vp, acl_type_t type, struct acl *aclp,
    struct ucred *cred, struct thread *td);

like, copy-paste this exactly, no cap 🫢


πŸŽ€ DESCRIPTION πŸŽ€

so this vnode call is literally how you set the access control list (ACL) for a file or directory. it's giving security gatekeeping energy πŸ‘‘

here's the breakdown of its arguments, bestie:

  • vp β€” the vnode of the file or directory. like, the actual thing you're touching.
  • type β€” the type of ACL to set. gotta know what flavor you're working with.
  • aclp β€” a pointer to an ACL structure from which to retrieve the ACL data. it's the source of truth.
  • cred β€” the user credentials to use in authorizing the request. who's asking?
  • td β€” the thread setting the ACL. the main character of this operation πŸ’…

now some very important details:

the aclp pointer may be NULL to indicate that the specified ACL should be deleted. so NULL = yeet it πŸ—‘οΈ

the cred pointer may be NULL to indicate that access control checks are not to be performed, if possible. this cred setting might be used to allow the kernel to authorize ACL changes that the active process might not be permitted to make. like, the kernel gets a vip pass, iykyk.

also, real talk: the vnode ACL interface defines the syntax, and not semantics, of file and directory ACL interfaces. more info about ACL management in kernel can be found in acl(9). go read it, bestie.


πŸ”’ LOCKS πŸ”’

the vnode will be locked on entry and should remain locked on return. no unlocking mid-operation, that's messy. periodt.


🌈 RETURN VALUES 🌈

if the ACL is successfully set, then zero is returned. slay. otherwise, an appropriate error code is returned. and we list those below πŸ‘‡


πŸ’€ ERRORS πŸ’€

  • [EINVAL] β€” the ACL type passed is invalid for this vnode, or the ACL data is invalid. like, wrong vibe entirely.
  • [EACCES] β€” the caller does not have the appropriate privilege. no permission, no entry πŸ™ˆ
  • [ENOMEM] β€” sufficient memory is not available to fulfill the request. brain empty, no thoughts.
  • [EOPNOTSUPP] β€” the file system does not support VOP_SETACL(). it's just not that girl.
  • [ENOSPC] β€” the file system is out of space. full house, no room.
  • [EROFS] β€” the file system is read-only. can't touch this πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

go click around, bestie, it's a whole ecosystem πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Robert Watson. iconic behavior, we love to see it πŸŽ€


okay that's the whole page! this was the Debian version, dated December 23, 1999 β€” a vintage slay πŸ’…βœ¨ go forth and set those ACLs, bestie! πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from