VOP_ACLCHECK(9)

πŸ’… VOP_ACLCHECK β€” bestie, let's check an access control list for a vnode πŸ’…

okay so this one lives in the Kernel Developer's Manual, section 9, and it's called VOP_ACLCHECK. no cap, it's a whole vnode call. let's get into it ✨


✨ SYNOPSIS ✨

first, the ritual. you gotta summon the headers:

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

and then the function itself, looking all main character:

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

she takes five arguments and returns an int. iconic behavior honestly 🫢


🌸 DESCRIPTION 🌸

so what does she do. this vnode call is your girl for figuring out whether a particular access control list (that's ACL for short, iykyk) is actually valid for a particular file or directory. vibe check on the ACL. that's the whole job. πŸ’–

and here's the cast of arguments, one by one:

  • vp β€” the vnode of the file or directory. the object in question, the star of the show πŸ‘‘
  • type β€” the type of ACL you wanna check. gotta say which flavor.
  • aclp β€” a pointer to an acl structure, and you pull the ACL data out of it. she's your source of truth.
  • cred β€” the user credentials used to authorize the request. who's asking, basically.
  • td β€” the thread that's checking the ACL. the one holding the clipboard πŸ“‹
ngl, the cred pointer can be NULL β€” and that means access control checks are not to be performed, if possible. the reason you'd ever do this? it lets the kernel authorize ACL verification that the active process might not otherwise be permitted to do. so like, the kernel gets a hall pass πŸ™ˆ

also important, and I need you to hear me on this one: the vnode ACL interface defines the syntax, not the semantics, of file and directory ACL interfaces. so it tells you how to say it, not what it means. if you want more deets on ACL management in the kernel, go read acl(9). πŸ¦‹


πŸ”’ LOCKS πŸ”’

no locks required to call this vnode method. zero. none. and here's the cute part β€” any locks held on entry will be held on exit. she does not touch your locks. she does not take your locks. she leaves them exactly where she found them. respectful queen πŸ’…


⭐ RETURN VALUES ⭐

so if the aclp pointer points to a valid ACL of type type for the object vp? you get zero back. slay. πŸŽ€

otherwise? you get an appropriate error code. and that's when you scroll down to the next section.


πŸ’€ ERRORS πŸ’€

here's the whole roster of ways this can go sideways:

  • [EINVAL] β€” the ACL type you passed is invalid for this vnode, OR the ACL data itself is invalid. something's wrong with the input, bestie.
  • [EACCES] β€” the file or directory ACL does not permit access. denied. not for you. 🚫
  • [ENOMEM] β€” there's not enough memory available to fulfill the request. she's trying her best but the RAM said no 😭
  • [EOPNOTSUPP] β€” the file system does not support VOP_ACLCHECK(). at all. it's just not that kind of file system. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

go read these next, fr fr:


🫢 AUTHORS 🫢

this manual page was written by Robert Watson. thank you for your service, king 🌈


and that's the whole page, bestie!! this one's from the Debian edition, dated December 23, 1999 β€” a vintage, truly, and she still ate. now go check those ACLs responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from