ACL_VALID(3)
π ACL_VALID(3) π
okay bestie, so this is a page from the Library Functions Manual (section 3, the library calls girlies π«Ά) and we're talking about acl_valid β yes it's literally in the Linux ACL world and it's lowkey one of the most useful little functions you'll ever meet. sit down, get comfy, let's get into it β¨
πΈ NAME πΈ
acl_valid β validate an ACL
like. it checks if your ACL is valid. that's the whole job. iconic behavior honestly π
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl).
so when you compile, you're linking -lacl and you're pulling from libacl. don't forget it or the linker will be SO dramatic about it π
β¨ SYNOPSIS β¨
#include <sys/types.h>
#include <sys/acl.h>
int
acl_valid(acl_t acl);
π¦ DESCRIPTION π¦
so the acl_valid() function checks the ACL that the argument acl points to, and it's asking one question: is this thing valid? is it giving what it's supposed to give? π
here's the tea on what "valid" actually means, because there are RULES:
- The three required entries
ACL_USER_OBJ,ACL_GROUP_OBJ, andACL_OTHERmust exist exactly once in the ACL. not zero times, not two times. exactly once. periodt. - If the ACL contains any
ACL_USERorACL_GROUPentries, then anACL_MASKentry is also required. no mask, no party π« - The ACL may contain at most one
ACL_MASKentry.
and there's more, because of course there is:
- The user identifiers must be unique among all entries of type
ACL_USER. - The group identifiers must be unique among all entries of type
ACL_GROUP.
no duplicates allowed, bestie. this function will absolutely clock you π
π RETURN VALUE π
The acl_valid() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
so: 0 = slay, -1 = check errno immediately, do not pass go π
π₯ ERRORS π₯
If any of the following conditions occur, the acl_valid() function returns -1 and sets errno to the corresponding value:
[EINVAL]β The argumentaclis not a valid pointer to an ACL.
The argument acl does not point to a valid ACL.
One or more of the required ACL entries is not present in acl.
The ACL contains entries that are not unique.
ngl EINVAL is doing a LOT of heavy lifting here, it's basically the catch-all bestie of error codes π«Ά
π STANDARDS π
IEEE Std 1003.1e draft 17 (βPOSIX.1eβ, abandoned)
not me telling you it's abandoned β yeah, the standard got ghosted, but the code is still out here living its best life π
π SEE ALSO π
acl_check(3), acl_set_file(3), acl(5)
go read the girlies 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>.
shoutout to them fr fr, they carried this whole page π«Ά
and that's the whole vibe check, bestie!! this page came from the Linux ACL crew and it's dated March 23, 2002 β yeah it's been around a minute, but it's still valid (see what i did there π
). go validate some ACLs, stay unique, and never forget your ACL_MASK πβ¨
π¦ 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