VOP_SETACL(9)
β¨ VOP_SETACL β¨
okay bestie, welcome to the VOP_SETACL page from the Kernel Developer's Manual, section 9 (that's the kernel-functions girly corner of the manpages π
). grab a strawberry matcha, we're setting access control lists on vnodes and it's gonna be adorable.
πΈ NAME πΈ
VOP_SETACL β set the access control list for a vnode
β¨ 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);
π DESCRIPTION π
so this vnode call is literally the one you use to set the access control list (ACL) for a file or directory. it's giving "i decide who gets in" energy π
its arguments are, in order, and yes you have to care about all of them:
vpβ the vnode of the file or directory. the main character, the thing you're editing.typeβ the type of ACL to set. yes there are types, no you can't just vibe your way through it.aclpβ a pointer to an ACL structure from which to retrieve the ACL data.credβ the user credentials to use in authorizing the request. the "who's asking" of it all.tdβ the thread setting the ACL. hi thread π«Ά
now here's the tea π: the aclp pointer may be NULL to indicate that the specified ACL should be deleted. poof, gone, no cap.
and 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. that's a lot of power, bestie, use it responsibly π
ngl the vnode ACL interface defines the syntax, and not semantics, of file and directory ACL interfaces. so it tells you how to say it, not what it means. more info about ACL management in the kernel lives over in acl(9) if you wanna go read it (you should, it's iconic).
π LOCKS π
the vnode will be locked on entry and should remain locked on return. that's the rule. don't unlock it, don't get cute, just keep it locked. periodt.
π RETURN VALUES π
if the ACL is successfully set, then zero is returned. slay, zero, success, we love her. β¨
otherwise, an appropriate error code is returned. an appropriate one. the kernel is being mature about it, you should be too.
π ERRORS π
[EINVAL]β the ACL type passed is invalid for this vnode, or the ACL data is invalid. wrong type or wrong data, either way it's a no from her π[EACCES]β the caller does not have the appropriate privilege. you simply are not that girl for this operation.[ENOMEM]β sufficient memory is not available to fulfill the request. the vibes ran out of RAM.[EOPNOTSUPP]β the file system does not supportVOP_SETACL(). this filesystem said "not my thing."[ENOSPC]β the file system is out of space. full. no room. tragic.[EROFS]β the file system is read-only. babe it is read-only, you cannot write to it, i'm so sorry π
π SEE ALSO π
go read the whole friend group, they're all connected, iykyk π¦
π AUTHORS π
this manual page was written by Robert Watson. thank you robert, absolute legend, ate and left no crumbs π
and that's the page!! this one shipped with Debian, dated December 23, 1999 β yes, 1999, it's vintage and it's still serving. mwah, go set some ACLs responsibly bestie πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1999, 2000, 2001 Robert N. M. Watson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms