ACL_GET_ENTRY(3)
β¨ ACL_GET_ENTRY(3) β¨
okay so bestie, welcome to the acl_get_entry page from the Linux Library Functions Manual π
this one's all about walking through an ACL entry by entry, like you're scrolling a group chat and reading every single message in order. no skipping. we don't skip. π«Ά
π NAME π
acl_get_entry β get an ACL entry
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl). yep, that's the one you link against π
π¦ SYNOPSIS π¦
#include <sys/types.h>
#include <sys/acl.h>
int
acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p);
π DESCRIPTION π
so the acl_get_entry() function hands you a descriptor for an ACL entry, and which entry you get depends on entry_id, inside the ACL that the acl argument points at. πΈ
- if
entry_idisACL_FIRST_ENTRY, the function drops intoentry_pa descriptor for the first ACL entry insideacl. starting from the top, main character energy π - if
entry_idisACL_NEXT_ENTRY, the function drops intoentry_pa descriptor for the next ACL entry insideacl. keep it moving, bestie β‘οΈ
now here's the part where you gotta pay attention, no cap π¨ β if you call acl_get_entry() with entry_id set to ACL_NEXT_ENTRY when there has not been either:
- an initial successful call to
acl_get_entry(), or - a previous successful call to
acl_get_entry()following a call toacl_calc_mask(),acl_copy_int(),acl_create_entry(),acl_delete_entry(),acl_dup(),acl_from_text(),acl_get_fd(),acl_get_file(),acl_set_fd(),acl_set_file(), oracl_valid()
then the effect is unspecified. like, genuinely unspecified. we do not know what happens. that's not a vibe, that's a warning π«
calls to acl_get_entry() do not modify any ACL entries. zero changes, we're just looking π subsequent operations that use the returned ACL entry descriptor operate on the ACL entry within the ACL in working storage. the order of all existing entries in the ACL stays exactly the same β untouched, unbothered. β¨ any existing ACL entry descriptors that refer to entries within the ACL keep on referring to those entries. any existing ACL pointers that refer to the ACL referred to by acl keep on referring to the ACL. everything stays put, periodt π
π₯ RETURN VALUE π₯
- if the function successfully gets an ACL entry, it returns a value of
1. slay π - if the ACL has no ACL entries, it returns the value
0. empty. nada. the void π³οΈ - if
entry_idisACL_NEXT_ENTRYand the last ACL entry in the ACL has already been returned by a previous call toacl_get_entry(), the function returns the value0until a successful call with anentry_idofACL_FIRST_ENTRYis made. you hit the end of the scroll and it just sits there at0until you go back to the top π - otherwise, the value
-1is returned anderrnois set to indicate the error. it's giving error energy π
π ERRORS π
if any of these conditions happen, acl_get_entry() returns -1 and sets errno to the matching value:
[EINVAL]β the argumentacl_pis not a valid pointer to an ACL.
also, the argument entry_id is neither ACL_NEXT_ENTRY nor ACL_FIRST_ENTRY. wrong flag, bestie, pick one of the two π
π STANDARDS π
IEEE Std 1003.1e draft 17 (βPOSIX.1eβ, abandoned)
(yes it says abandoned. we still love her. iconic even in retirement π)
π SEE ALSO π
acl_calc_mask(3), acl_create_entry(3), acl_copy_entry(3), acl_delete_entry(3), acl_get_file(3), acl(5)
go read those too, they're all connected, iykyk π
π§ 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>. legends, honestly π«Ά
and that's the whole page bestie!! πΈ this one came from the Linux ACL crew and it's dated March 23, 2002 β old but gold, still hitting different. go forth and iterate those ACL entries responsibly πβ¨π
π¦ 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