ACL_CMP(3)

πŸ“¦
version 2.4.0 Β· 2 versions
  • 2.4.0 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 15.1 Β· freebsd 15.1
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 ACLs acl1 and acl2 are equal πŸ₯³
  • 1 β€” they differ πŸ’€ not the same bestie
  • -1 β€” something went wrong, and the global variable errno gets set to indicate the error 😭
if it's successful it returns 0 or 1, and -1 only 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 argument acl1 is not a valid pointer to an ACL.
  • [EINVAL] β€” The argument acl2 is 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