ACL_CLEAR_PERMS(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_CLEAR_PERMS ✨

okay bestie, so this one's from the Linux Access Control Lists library, aka libacl, and you link it with -lacl. it's page acl_clear_perms(3) from the Library Functions Manual and honestly? it's giving "small but mighty" πŸ’…


🌸 NAME 🌸

acl_clear_perms β€” clears all the permissions from an ACL permission set. every single one. gone. bye. 🧹✨


πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library β€” that's libacl, and you link it with -lacl. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

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

int
acl_clear_perms(acl_permset_t permset_d);

look at her. two includes, one function, zero drama. 😌


πŸ’– DESCRIPTION πŸ’–

so the way this works is, acl_clear_perms() clears all the permissions from the permission set that the argument permset_d is referring to. like, every permission in there? wiped. the permset is empty bestie, it's on a cleanse πŸ§–β™€οΈ

and here's the cute part β€” any existing descriptors that refer to permset_d shall continue to refer to that permission set. so nobody's pointer gets orphaned, everybody still knows where home is. 🏠🫢


πŸ”₯ RETURN VALUE πŸ”₯

  • returns the value 0 if it worked. slay. βœ…
  • otherwise it returns the value -1, and the global variable errno gets set to indicate the error. 😭

πŸ’€ ERRORS πŸ’€

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

  • [EINVAL] β€” the argument permset_d is not a valid descriptor for a permission set within an ACL entry. like girl, that's not a permset, what is that πŸ™ˆ

πŸ‘‘ STANDARDS πŸ‘‘

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

not me crying over POSIX.1e being abandoned... it's fine. it's totally fine. 😭 the draft is real to us.

🌈 SEE ALSO 🌈

go read the whole friend group, they're all icons fr fr πŸ’œ


πŸ¦‹ 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 bestie β€” Linux ACL, dated March 23, 2002, page ACL_CLEAR_PERMS(3). mwah, go clear some perms responsibly πŸ’…πŸŒŸ

πŸ“¦ where this page comes from