ACL_CMP(3)
π acl_cmp β compare two ACLs π
okay bestie, so you're hanging out in the Library Functions Manual, section 3, and you want to know if two ACLs are literally the same. say less. that's what acl_cmp is for, and she ate. π
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl). she's living in there, rent free. β¨
π SYNOPSIS π
#include <sys/types.h>
#include <acl/libacl.h>
int
acl_cmp(acl_t acl1, acl_t acl2);
two ACLs walk into a function. what happens next is between them. π
π¦ DESCRIPTION π¦
so like. acl_cmp() takes the two ACLs that acl1 and acl2 point at and compares them for equality. it's giving "are you two the same or not" energy.
and the way it decides they're equal? iconic honestly: the two ACLs count as equal if for each entry in acl1 there is an entry in acl2 with matching tag type, qualifier, and permissions, and vice versa. π
that "and vice versa" is doing a LOT of work btw. it goes both ways. mutual matching. reciprocal. it's a whole relationship. π«Ά
β¨ RETURN VALUE β¨
0β the two ACLsacl1andacl2are equal π₯³1β they differ π not the same bestie-1β something went wrong, and the global variableerrnogets set to indicate the error π
if it's successful it returns0or1, and-1only shows up when there's an actual error. don't get it twisted. π
π¨ ERRORS π¨
if any of these conditions happen, acl_cmp() returns -1 and sets errno to the corresponding value. no cap, this is the drama:
[EINVAL]β The argumentacl1is not a valid pointer to an ACL.[EINVAL]β The argumentacl2is not a valid pointer to an ACL.
(yes bestie, it's the same error for both, one bullet each, that's just how the page vibes. π)
πΈ STANDARDS πΈ
so this one is a non-portable, Linux specific extension to the ACL manipulation functions defined in IEEE Std 1003.1e draft 17 (βPOSIX.1eβ, abandoned). "abandoned" is so real of them. π she's a Linux girlie only, don't bring her to other platforms and expect her to perform. π
π SEE ALSO π
that's it. that's the whole friend group. iykyk. π
π AUTHOR π
Written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>. give them their flowers, fr fr. πΉ
and that's the tea, bestie π β this page came to you from Linux ACL, dated March 23, 2002, and it lives happily ever after as ACL_CMP(3). now go compare some ACLs responsibly. 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