ACL_GET_PERM(3)
π ACL_GET_PERM β bestie's guide to peeking at permissions
okay so this is a page from ACL_GET_PERM(3), aka section 3 of the Library Functions Manual, and it's literally just "does this permission set contain this one permission?" no cap. it's giving tiny function, huge main character energy. let's go π¦
β¨ NAME β¨
acl_get_perm β test for a permission in an ACL permission set π
π LIBRARY π
Linux Access Control Lists library (libacl, link it with -lacl) β yeah bestie, you gotta bring the library to the party π
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <acl/libacl.h>
int
acl_get_perm(acl_permset_t permset_d, acl_perm_t perm);
look at that signature. so clean. so iconic. β¨
π« DESCRIPTION π«
so the acl_get_perm() function does one (1) job and she does it well: she tests whether the permission you named in the argument perm is contained in the ACL permission set pointed to by the argument permset_d.
and what even is perm allowed to be, you ask? it's one of ACL_READ, ACL_WRITE, ACL_EXECUTE. those three. that's the whole menu. π
and here's the cute part β any existing descriptors that refer to permset_d continue to refer to that permission set. nothing gets yanked out from under you. she's stable. she's loyal. π«Ά
π RETURN VALUE π
if it works out (and it will, bestie), acl_get_perm() returns:
1β yesss, the permission specified bypermis contained in the ACL permission setpermset_dβ0β nope, that permission is not contained in the permission set π
otherwise, the value -1 is returned and the global variable errno gets set to indicate the error. sad girl hours. π
π ERRORS π
if any of the following conditions occur, acl_get_perm() returns -1 and sets errno to the corresponding value β read these, fr fr, don't skip:
[EINVAL]β the argumentpermset_dis not a valid descriptor for a permission set within an ACL entry. or the argumentpermis not a validacl_perm_tvalue. two ways to fail this vibe check, pick neither. β οΈ
ngl, EINVAL is just the universe saying "that's not a real thing, babe."
π STANDARDS π
this is a non-portable, Linux specific extension to the ACL manipulation functions defined in IEEE Std 1003.1e draft 17 ("POSIX.1e", abandoned). yes, abandoned. we don't talk about it. π
so like, don't expect your BSD bestie's system to know what you're talking about. this is a Linux-only slay.
π SEE ALSO π
go read her friends, they're all icons:
π§ AUTHOR π§
written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>. thank you for your service, king π«‘π
and that's the whole page, bestie!! πΈ this was the Linux ACL manual page for acl_get_perm(3), dated March 23, 2002, from the Linux ACL source. go forth and check those permissions, periodt. π
β¨π¦π
π¦ where this page comes from
- alpine 3.22: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.23: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.24: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- 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+
- debian bookworm: libacl1-dev 2.3.1-3
- debian trixie: libacl1-dev 2.3.2-2+b1
- fedora 43: libacl-devel 2.3.2-4.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.3.2-4.fc43 Β· LGPL-2.1-or-later
- 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.3.2-6.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.3.2-6.fc44 Β· 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 jammy: libacl1-dev 2.3.1-1
- ubuntu noble: libacl1-dev 2.3.2-1build1
- ubuntu noble: libacl1-dev 2.3.2-1build1.1
- ubuntu resolute: libacl1-dev 2.3.2-2
- 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