ACL_SET_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_SET_QUALIFIER(3) β€” Library Functions Manual

okay bestie, pull up a chair, we're doing a manual page from the Linux Access Control Lists library (that's libacl, link it with -lacl) πŸŽ€ and honestly? it's a good one. the function is acl_set_qualifier, and the whole vibe is: you have an ACL entry, and you want to change who or what it's about. iconic behavior. let's go ✨


🌸 NAME 🌸

acl_set_qualifier β€” set the qualifier of an ACL entry

like, the qualifier. the little "which user" / "which group" part. the who in the who gets what. 🫢


πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library (libacl, -lacl).


πŸ¦‹ SYNOPSIS πŸ¦‹

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

int
acl_set_qualifier(acl_entry_t entry_d, const void *qualifier_p);

✨ DESCRIPTION ✨

so. acl_set_qualifier() sets the qualifier of the ACL entry pointed at by the argument entry_d to the value referred to by the argument qualifier_p. simple as that. πŸ’–

here's the part you cannot fumble, and i say this with love:

  • if the value of the tag type in the ACL entry referred to by entry_d is ACL_USER, then the value referred to by qualifier_p shall be of type uid_t πŸ‘‘
  • if the value of the tag type in the ACL entry referred to by entry_d is ACL_GROUP, then the value referred to by qualifier_p shall be of type gid_t 🌈
  • if the value of the tag type in the ACL entry referred to by entry_d is a tag type for which a qualifier is not supported, acl_set_qualifier() returns an error. no qualifier for you, babe. πŸ’€

also important, and it's giving "your pointers still work":

Any ACL entry descriptors that refer to the entry referred to by entry_d continue to refer to that entry. no dangling, no ghosting, we love that for them 🫢

and the memory tea πŸ“: this function may cause memory to be allocated. so the caller should free any releasable memory, when the ACL is no longer required, by calling acl_free() with a pointer to the ACL as argument. clean up after yourself, bestie, it's self care. ✨


πŸ’œ RETURN VALUE πŸ’œ

acl_set_qualifier() returns the value 0 if successful πŸŽ‰ otherwise the value -1 is returned and the global variable errno is set to indicate the error 😭


πŸ’€ ERRORS πŸ’€

if any of the following conditions occur, the acl_set_qualifier() function returns -1 and sets errno to the corresponding value:

  • [EINVAL] β€” any of these, and they're all "girl what":
    • The argument entry_d is not a valid descriptor for an ACL entry.
    • The value of the tag type in the ACL entry referenced by the argument entry_d is neither ACL_USER nor ACL_GROUP.
    • The value pointed to by the argument qualifier_p is not valid.
  • [ENOMEM] β€” The acl_set_qualifier() function is unable to allocate the memory required for the ACL qualifier. (the machine said "no πŸ’€")

πŸ‘‘ STANDARDS πŸ‘‘

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

abandoned. the standard got ghosted. we still use it anyway. main character energy 🧚

πŸ”₯ SEE ALSO πŸ”₯

iykyk, go read the whole squad πŸ“–


πŸŽ€ 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>. legends, honestly. thank you for your service πŸ«‘πŸ’–


and that's the page!! this one's from Linux ACL, dated March 23, 2002 β€” vintage, but still slaying. go set some qualifiers, bestie, you got this πŸŒŸπŸ’…

πŸ“¦ where this page comes from