ACL_ADD_PERM(3)
π ACL_ADD_PERM π
okay so bestie, welcome to ACL_ADD_PERM(3) β yeah that's section 3 of the Library Functions Manual, we love a glow-up. this is the lil function that hands your permission set a brand new permission. she's small, she's mighty, she's giving β¨gatekeeper of the vibesβ¨. let's get into it π«Ά
πΈ NAME πΈ
acl_add_perm β add a permission to an ACL permission set. that's it, that's the whole job, and she does it flawlessly π
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl). yes queen, you gotta link her in π
β¨ SYNOPSIS β¨
#include <sys/types.h>
#include <sys/acl.h>
int
acl_add_perm(acl_permset_t permset_d, acl_perm_t perm);
π« DESCRIPTION π«
so acl_add_perm() takes the permission sitting inside the argument perm β and bestie, perm is one of ACL_READ, ACL_WRITE, ACL_EXECUTE β and drops it into the permission set that the argument permset_d is pointing at. slay π
and like, if you try to add a permission that's already in the permission set? not an error. not a problem. not a scandal. she just vibes. it's giving "oh you're already here? cool, stay." π¦
also, important, no cap: any existing descriptors that refer to permset_d keep on referring to that same permission set. nobody gets swapped out, nobody gets ghosted. the way that continuity just works π₯
π RETURN VALUE π
acl_add_perm() returns the value 0 if it succeeded. iconic. perfect. ate and left no crumbs.
otherwise the value -1 comes back, and the global variable errno gets set to tell you what went wrong. π rude but informative.
π¨ ERRORS π¨
if any of these conditions happen, acl_add_perm() returns -1 and sets errno to the corresponding value:
[EINVAL]β the argumentpermset_dis not a valid descriptor for a permission set within an ACL entry.
also [EINVAL] β the argument perm does not contain a valid acl_perm_t value.
fr fr, if you see EINVAL, something you passed in was Not It. check your descriptor, check your perm value, hydrate, try again π§
π STANDARDS π
IEEE Std 1003.1e draft 17 (βPOSIX.1eβ, abandoned)
and here's the tea β: in the Linux implementation, perm is a bitwise set of permissions that acl_add_perm() will all add at once. very efficient, very main character. but this use is not portable. so if you're taking your code anywhere else, heads up bestie, that trick doesn't travel βοΈπ
π SEE ALSO π
π AUTHOR π
Derived from the FreeBSD manual pages written by Robert N M Watson <rwatson@FreeBSD.org>, and adapted for Linux by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>.
shoutout to the legends who wrote the lore π«‘π
and that's the whole page, bestie!! Linux ACL, March 23, 2002 β ACL_ADD_PERM(3), forever in our hearts. go add some permissions, you absolute icon πβ
π¦ where this page comes from
- arch rolling: acl 2.4.0-1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- centos-stream 10: libacl-devel 2.4.0-2.el10 Β· LGPL-2.1-or-later
- centos-stream 9: libacl-devel 2.4.0-2.el9 Β· LGPLv2+
- centos-stream 9: libacl-devel 2.4.0-2.el9 Β· LGPLv2+
- fedora 43: libacl-devel 2.4.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.4.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.4.0-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.4.0-1.fc44 Β· LGPL-2.1-or-later
- nixpkgs unstable: acl 2.4.0
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: libacl1-dev 2.4.0-1
- (C) 2002 Andreas Gruenbacher, <andreas.gruenbacher@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms