VOP_GETACL(9)

πŸ’… VOP_GETACL β€” the Kernel Developer's Manual page, but make it cute

okay so bestie, welcome to VOP_GETACL(9) from the Kernel Developer's Manual πŸŽ€ this is the page about pulling an access control list off a vnode, and we're gonna get through it together, no cap.


✨ NAME ✨

VOP_GETACL β€” retrieve access control list for a vnode πŸ¦‹


✨ SYNOPSIS ✨

like, here's the whole vibe, literally exactly as it is:

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

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

she's giving kernel function signature and she ate πŸ’…


✨ DESCRIPTION ✨

so this vnode call is the one you use when you wanna retrieve the access control list (ACL) from a file or directory. iconic behaviour fr fr 🌸

its arguments are, and listen, we're going through all of them:

  • vp β€” the vnode of the file or directory πŸ‘‘
  • type β€” the type of ACL to retrieve
  • aclp β€” a pointer to an ACL structure that's gonna receive the ACL data 🫢
  • cred β€” the user credentials used to authorize the request
  • td β€” the thread that's requesting the ACL

okay so about that cred pointer: it 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 retrieval that the active process might not be permitted to do. sneaky? maybe. valid? yes. ✨

also super important: the vnode ACL interface defines the syntax, and not the semantics, of file and directory ACL interfaces. so don't come for her about behaviour, that's not her job bestie 😭 more info about ACL management in kernel can be found in acl(9).


✨ LOCKS ✨

the vnode will be locked on entry and should remain locked on return. periodt. don't unlock her, don't touch her, she stays locked πŸ’€


✨ RETURN VALUES ✨

if the aclp pointer will point to a valid ACL, then zero is returned. otherwise, an appropriate error code is returned. that's it, that's the deal πŸŽ€


✨ ERRORS ✨

here's the whole roster of ways this can go sideways, and yes we're listing every single one:

  • [EINVAL] β€” the ACL type passed is invalid for this vnode πŸ™ˆ
  • [EACCES] β€” the caller does not have the appropriate privilege πŸ”₯
  • [ENOMEM] β€” sufficient memory is not available to fulfill the request 😭
  • [EOPNOTSUPP] β€” the file system does not support VOP_GETACL() πŸ’€

✨ SEE ALSO ✨

go read these next, bestie, they're all in the friend group:


✨ AUTHORS ✨

this manual page was written by Robert Watson. thank you king, we appreciate you πŸ«ΆπŸ‘‘


and that's the whole page, you're literally a VOP_GETACL expert now, main character energy only ✨

this little cutie came from Debian, dated December 23, 1999, and it's filed under VOP_GETACL(9) β€” mwah, go forth and retrieve those ACLs πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from