ACL_GET_QUALIFIER(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_QUALIFIER(3) ✨

okay bestie, pull up a chair because we're doing acl_get_qualifier from the Library Functions Manual and honestly? it's giving "small function, big main character energy." πŸ’…


🌸 NAME 🌸

acl_get_qualifier β€” retrieve the qualifier from an ACL entry


πŸŽ€ LIBRARY πŸŽ€

Linux Access Control Lists library (libacl, -lacl). yes queen, link it. πŸ”—


πŸ¦‹ SYNOPSIS πŸ¦‹

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

void *
acl_get_qualifier(acl_entry_t entry_d);

πŸ’– DESCRIPTION πŸ’–

so what does acl_get_qualifier() actually do? it reaches into the ACL entry that entry_d points at, pulls the qualifier out into working storage, and hands you back a pointer to that storage. snatched. ✨

now here's the tea about what that pointer actually is, because it depends on the tag type, and this part matters:

  • if the tag type in the ACL entry that entry_d refers to is ACL_USER, then the value acl_get_qualifier() returns is a pointer to type uid_t.
  • if the tag type in that same ACL entry is ACL_GROUP, then the value returned is a pointer to type gid_t.
  • but if the tag type in the ACL entry is a tag type where a qualifier isn't supported at all, then acl_get_qualifier() returns (void *)NULL and the function fails. no qualifier for you, bestie. 😭

also super important: any operations you do afterwards using that returned pointer are working on an independent copy of the qualifier sitting in working storage. so they will not change the qualifier of the actual ACL entry. it's a copy, not the original, iykyk. 🫢

heads up: this function may cause memory to be allocated. so when you're done with the new qualifier, you the caller should free any releasable memory by calling acl_free() and passing it that void * value that acl_get_qualifier() gave you. don't leave it hanging, that's not the vibe. 🧚

and the good news? the argument entry_d, plus any other ACL entry descriptors that refer to entries inside the ACL containing the entry that entry_d refers to, keep referring to those entries. nothing gets shuffled. the order of all the existing entries in that ACL stays exactly the same. iconic, no notes. πŸ‘‘


🌈 RETURN VALUE 🌈

  • on success πŸŽ‰ β€” the function returns a pointer to the tag qualifier that was retrieved into ACL working storage.
  • on error πŸ’€ β€” a value of (void *)NULL is returned, and errno is set appropriately.

⭐ ERRORS ⭐

if any of these conditions happen, acl_get_qualifier() returns (void *)NULL and sets errno to the matching value:

  • [EINVAL] β€” the argument entry_d is not a valid descriptor for an ACL entry.

ALSO, same error code: the value of the tag type in the ACL entry referenced by the argument entry_d is neither ACL_USER nor ACL_GROUP. (yeah, both of these live under EINVAL, that's just how it is. πŸ™ˆ)

  • [ENOMEM] β€” the value to be returned requires more memory than is allowed by the hardware or the system-imposed memory management constraints. it's not you, it's the memory limits. 😭

πŸ’œ STANDARDS πŸ’œ

IEEE Std 1003.1e draft 17 (β€œPOSIX.1e”, abandoned). yeah. abandoned. we don't talk about it. πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

acl_create_entry(3), acl_free(3), acl_get_entry(3), acl_get_permset(3), acl_get_tag_type(3), acl_set_permset(3), acl_set_qualifier(3), acl_set_tag_type(3), acl(5)


πŸ‘‘ 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>.


and that's the whole page, bestie! πŸŽ€ this one came out of the Linux ACL manual, dated March 23, 2002 β€” yeah, it's an elder but it still slays. go forth and qualifier responsibly. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from