ACL_SET_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_SET_PERMSET(3) ✨

okay bestie, so this is a page from the Library Functions Manual and it's literally all about acl_set_permset β€” say it with me, "set permset," it's giving exactly what it sounds like πŸ’…


πŸ’– NAME πŸ’–

acl_set_permset β€” set the permission set in an ACL entry

no cap, that's the whole job. it sets. the permset. in an entry. πŸŽ€


🌸 LIBRARY 🌸

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

so like, link with -lacl or this whole vibe is not happening for you 🫢


✨ SYNOPSIS ✨

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

int
acl_set_permset(acl_entry_t entry_d, acl_permset_t permset_d);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the acl_set_permset() function sets the permission set of the ACL entry indicated by the argument entry_d to the permissions contained in the argument permset_d. like, you hand it an entry, you hand it a permset, and boom β€” that entry now has those permissions. main character energy fr fr πŸ‘‘

and here's the part that's lowkey important: any ACL entry descriptors that refer to the entry containing the permission set referred to by permset_d shall continue to refer to those entries. and any ACL entry descriptors that refer to the entry referred to by entry_d shall continue to refer to that entry. nothing gets re-pointed, nobody gets ghosted, the descriptors stay exactly where they were. we love stability. periodt πŸ’œ


πŸ”₯ RETURN VALUE πŸ”₯

acl_set_permset() returns the value 0 if successful 😌✨

otherwise, the value -1 is returned and the global variable errno is set to indicate the error. so yeah, if you get a -1, go read errno, it's spilling the tea about what went wrong 😭


πŸ’€ ERRORS πŸ’€

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

  • [EINVAL] β€” The argument entry_d is not a valid descriptor for an ACL entry.
  • [EINVAL] β€” The argument permset_d is not a valid descriptor for a permission set within an ACL entry.
  • [EINVAL] β€” The argument permset_d contains values which are not valid acl_permset_t values.

so basically if your descriptors are fake, or your permset has values that aren't real acl_permset_t values, EINVAL said "not today" πŸ™ˆ


🌈 STANDARDS 🌈

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

rip POSIX.1e, gone but not forgotten πŸ•ŠοΈ the draft was abandoned, bestie, that's just the lore.


πŸ’œ SEE ALSO πŸ’œ

acl_add_perm(3), acl_clear_perms(3), acl_delete_perm(3), acl_get_perm(3), acl_get_permset(3), acl_get_qualifier(3), acl_get_tag_type(3), acl_set_qualifier(3), acl_set_tag_type(3), acl(5)

go read the whole squad, they all hang out together iykyk 🧚


πŸŽ€ 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>.

thank you for your service, legends 🫢


and that's the whole page!! this came from the Linux ACL crew, dated March 23, 2002 β€” yeah it's vintage, it's iconic, it's ACL_SET_PERMSET(3) and it ate πŸ’…β­

πŸ“¦ where this page comes from