ACL_FROM_TEXT(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_FROM_TEXT(3) ✨

okay bestie, we're in the Library Functions Manual today and the page is called ACL_FROM_TEXT(3) but the function we're actually talking about is acl_to_text β€” yes it's giving "the filename doesn't match the vibe" but we move πŸ’…


🌸 NAME 🌸

acl_to_text β€” convert an ACL to text

πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library (libacl, -lacl). that's the whole lib, she's small but she's powerful 🫢

✨ SYNOPSIS ✨

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

char *
acl_to_text(acl_t acl, ssize_t *len_p);

πŸ’– DESCRIPTION πŸ’–

so acl_to_text() takes the ACL that the argument acl points at and translates it into a NULL terminated character string. that's the whole job. she's a translator, not a surgeon.

if the pointer len_p is not NULL, then the function drops the length of the string (and NOT including the NULL terminator, okay, read that again) into the location that len_p points to. like she's handing you the receipt too 🧾

the format of the text string that comes back from acl_to_text() is the long text form defined in acl(5). and lowkey the best part: the ACL referred to by acl is not changed. she does not touch your stuff. queen behavior, no cap πŸ‘‘

this function allocates whatever memory it needs to hold the string, and returns a pointer to that string. so the caller β€” that's you bestie β€” should free any releasable memory when the new string isn't needed anymore, by calling acl_free(3) with the (void*)char returned by acl_to_text() as an argument.

not me handing you a string and then making you clean it up 😭 that's just how it is though. free your memory fr fr.

πŸ”₯ RETURN VALUE πŸ”₯

on success, this function returns a pointer to the long text form of the ACL. slay.

on error, a value of (char *)NULL is returned, and errno is set appropriately. πŸ’€

😭 ERRORS 😭

if any of the following conditions occur, the acl_to_text() function returns a value of (char *)NULL and sets errno to the corresponding value:

  • [EINVAL] β€” the argument acl is not a valid pointer to an ACL.
    • also: the ACL referenced by acl contains one or more improperly formed ACL entries, or for some other reason cannot be translated into a text form of an ACL. like she tried, she really did, but the input was messy πŸ™ˆ
  • [ENOMEM] β€” the character string to be returned requires more memory than is allowed by the hardware or system-imposed memory management constraints. the string was simply too iconic for your RAM 🫠

🌈 STANDARDS 🌈

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

abandoned. the standard got ghosted πŸ‘» rip bozo, but the function lives on

πŸ‘‘ SEE ALSO πŸ‘‘

acl_free(3), acl_from_text(3), acl_to_any_text(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 page, bestie! this one came from the Linux ACL manual and it's dated March 23, 2002 β€” yeah she's an elder but she's still serving πŸ’œ go free your strings, drink water, and stan acl_to_text. mwah πŸ¦‹βœ¨

πŸ“¦ where this page comes from