ACL_GET_PERMSET(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 14.5, 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_get_permset β€” bestie, let's get that permission set πŸ’–

okay so you're deep in libacl (that's the Linux Access Control Lists library, aka libacl, link it with -lacl), and you need the permission set out of an ACL entry? say less. this is the acl_get_permset(3) page from the Library Functions Manual and it's about to be your new fave. 🫢


✨ NAME ✨

acl_get_permset β€” retrieve the permission set from an ACL entry

πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library (libacl, -lacl). yes queen, link the library.

🌸 SYNOPSIS 🌸

#include <sys/types.h>
#include <sys/acl.h>

int
acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the acl_get_permset() function hands you back, inside permset_p, a descriptor to the permission set living in the ACL entry that entry_d points at. it's giving "here's your lil handle, go wild." ✨

and the important part: any operations you do afterward using that returned permission set descriptor are operating on the permission set within the ACL entry itself. not a copy. the actual one. πŸ’…

also, any ACL entry descriptors that refer to the entry that entry_d refers to? they shall continue to refer to those entries. no identity crises here, everybody keeps pointing where they were pointing. periodt.

πŸ”₯ RETURN VALUE πŸ”₯

  • returns the value 0 if it's successful β€” slay πŸ’–
  • otherwise returns the value -1, and the global variable errno gets set to indicate the error 😭

πŸ’€ ERRORS πŸ’€

if any of these conditions happen, acl_get_permset() returns -1 and sets errno to the matching value:

  • [EINVAL] β€” the argument entry_d is not a valid descriptor for an ACL entry. that's it, that's the one. not valid = not valid, bestie.

πŸ‘‘ STANDARDS πŸ‘‘

IEEE Std 1003.1e draft 17 (β€œPOSIX.1e”, abandoned)

ok lowkey the tea is that POSIX.1e was abandoned πŸ™ˆ but our girl acl_get_permset is still out here doing her thing, main character energy fr fr.

🌈 SEE ALSO 🌈

πŸŽ€ 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 the legends who wrote this so we could vibe with ACLs today 🫢


and that's the whole page, bestie!! πŸ’œ this was the Linux ACL manual page for acl_get_permset(3), dated March 23, 2002. go forth and retrieve those permission sets, you absolute icon πŸ‘‘βœ¨ no cap.

πŸ“¦ where this page comes from