ACL_COPY_INT(3)

πŸ’– acl_copy_int β€” bestie's guide to the ACL glow-up πŸ’–

okay so real talk, this one lives in the Linux Access Control Lists library, aka libacl, and you link it with -lacl. it's from the Library Functions Manual, section 3. iykyk πŸ’…


✨ NAME ✨

acl_copy_int β€” copy an ACL from external to internal representation

like. it takes the outside version and gives it a whole internal makeover. main character transformation energy πŸ¦‹


πŸŽ€ LIBRARY πŸŽ€

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


🌸 SYNOPSIS 🌸

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

acl_t
acl_copy_int(const void *buf_p);

πŸ’œ DESCRIPTION πŸ’œ

so acl_copy_int() takes an exportable, contiguous, persistent form of an ACL β€” that's the one pointed to by buf_p β€” and copies it into the internal representation. external form goes in, working-storage ACL comes out. slay ✨

heads up bestie: this function may cause memory to be allocated. so when you're done with the new ACL, you have to free any releasable memory yourself. the way to do that is calling acl_free(3) with the (void*)acl_t that acl_copy_int() returned, passed as the argument. don't ghost it, actually free it 😭

πŸ”₯ RETURN VALUE πŸ”₯

if it eats, it returns a pointer that references the ACL in working storage. πŸŽ€

if it doesn't, you get (acl_t)NULL back, and errno gets set appropriately. no cap.


πŸ’€ ERRORS πŸ’€

if any of these conditions happen, acl_copy_int() returns (acl_t)NULL and sets errno to the matching value:

  • [EINVAL] β€” the buffer pointed to by the argument buf_p does not contain a valid external form ACL. like the vibe check failed fr fr πŸ™ˆ
  • [ENOMEM] β€” the ACL working storage needs more memory than the hardware or the system-imposed memory management constraints allow. she's asking for more than the universe can give πŸ’…

πŸ‘‘ STANDARDS πŸ‘‘

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

yes bestie, abandoned. we still love her though. periodt.

🌈 SEE ALSO 🌈

acl_copy_ext(3), acl_get_entry(3), acl_free(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 shipped as part of the Linux ACL manual, dated March 23, 2002 β€” ACL_COPY_INT(3), iconic, no notes. now go free your ACLs πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from