ACL_DELETE_PERM(3)
π ACL_DELETE_PERM π
okay bestie, so this is acl_delete_perm(3) from the Library Functions Manual, and it's literally the "un-adding" button for ACL permissions. it's giving β¨subtractionβ¨
π NAME π
acl_delete_perm β delete a permission from an ACL permission set
no cap, that's the whole job. bye bye permission π
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl).
so when you're linking, you want that -lacl on the line, okurrr π«Ά
β¨ SYNOPSIS β¨
#include <sys/types.h>
#include <sys/acl.h>
int
acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm);
two includes, one function, iconic behavior honestly π
πΈ DESCRIPTION πΈ
so the way that acl_delete_perm() works is it deletes the permission contained in the argument perm from the permission set that permset_d is pointing at. and perm is one of ACL_READ, ACL_WRITE, ACL_EXECUTE β those are the three flavors, pick your fighter π₯
and here's the chill part: if you try to delete a permission that isn't even in there? that is not considered an error. the function just shrugs, says "already not there bestie", and moves on. no drama, no errno, nothing. we love a low-stakes queen π¦
also, any existing descriptors that refer to permset_d continue to refer to that permission set. like, they're still holding hands with the same set. the deletion happens in the set, not to the set. periodt.
π₯ RETURN VALUE π₯
acl_delete_perm() returns the value 0 if it slayed successfully π
otherwise, the value -1 comes back and the global variable errno gets set to indicate the error. so if it's giving -1, go check errno, that's where the tea is π
π ERRORS π
if any of these conditions occur, acl_delete_perm() returns -1 and sets errno to the corresponding value:
[EINVAL]β two separate ways to earn this one, bestie:- the argument
permset_dis not a valid descriptor for a permission set within an ACL entry. like it's just... not a real permset. π« - the argument
permdoes not contain a validacl_perm_tvalue. wrong flavor, wrong vibe. π
- the argument
π STANDARDS π
IEEE Std 1003.1e draft 17 (aka βPOSIX.1eβ β abandoned, RIP boo, you would've loved it here ποΈ)
and here's the tea for the Linux girlies specifically: in the Linux implementation,permis a bitwise set of permissions thatacl_delete_perm()will all remove at once. so you can nuke several at the same time. BUT β and this is the important part β this use is not portable. so if you take it anywhere else, it might not hit the same. iykyk β οΈ
π SEE ALSO π
the whole friend group, go say hi:
π«Ά 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>.
thank you for your service, legends π
okay that's the whole page, you're officially educated π this was Linux ACL, dated March 23, 2002, and the page is ACL_DELETE_PERM(3). go forth and delete permissions responsibly, bestie πβ¨
π¦ 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