ACL_EQUIV_MODE(3)
π ACL_EQUIV_MODE(3) π
ok so bestie, this one lives in the Library Functions Manual, it's acl_equiv_mode from the Linux Access Control Lists library (libacl, link it with -lacl), and it's genuinely one of the cutest little functions in the whole ACL game. let's get into it π
β¨ NAME β¨
acl_equiv_mode β check for an equivalent ACL
π¦ LIBRARY π¦
Linux Access Control Lists library (libacl, -lacl).
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <acl/libacl.h>
int
acl_equiv_mode(acl_t acl, mode_t *mode_p);
π DESCRIPTION π
ok so here's the tea: acl_equiv_mode() looks at the ACL that acl points to and asks β is this thing just the bare minimum? like, does it contain only the required ACL entries, the ones with tag types ACL_USER_OBJ, ACL_GROUP_OBJ, and ACL_OTHER, and does it contain no permissions other than ACL_READ, ACL_WRITE, or ACL_EXECUTE? π
if the ACL is shaped like that, it can be fully represented with the traditional file permission bits, and it's considered equivalent with the traditional file permission bits. no cap. that's the whole vibe check. β
and listen β if acl is an equivalent ACL and the pointer mode_p is not NULL, then the value pointed to by mode_p gets set to the value that defines the same owner, group and other permissions as contained in the ACL. so you get your classic mode bits handed back to you. iconic. π«Ά
π RETURN VALUE π
on success, this function returns the value 0 if acl is an equivalent ACL, and the value 1 if acl is not an equivalent ACL. on error, the value -1 is returned, and errno is set appropriately.
yes bestie, 1 is a success return here, not a failure β read it again, it's literally the answer to the question. π
π ERRORS π
if any of the following conditions occur, the acl_equiv_mode() function returns the value -1 and sets errno to the corresponding value:
[EINVAL]β The argumentaclis not a valid pointer to an ACL.
π 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). so likeβ¦ it's giving Linux-only, and yes the standard it extends is abandoned, we don't talk about that π
π₯ SEE ALSO π₯
π AUTHOR π
Written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>.
and that's the whole page bestie!! π this one's from Linux ACL, dated March 23, 2002 β shoutout to the classics, mwah ππβ¨
π¦ 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