ACL_TO_ANY_TEXT(3)
β¨ ACL_TO_ANY_TEXT(3) β¨
okay bestie, so this is a page from the Library Functions Manual, and it's about acl_to_any_text β the little function that turns an ACL into text. yes, the whole thing. π let's get into it.
πΈ NAME πΈ
acl_to_any_text β convert an ACL to text
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl). that's the vibe, that's the whole library. π«Ά
π SYNOPSIS π
#include <sys/types.h>
#include <acl/libacl.h>
char *
acl_to_any_text(acl_t acl, const char *prefix, char separator,
int options);
π DESCRIPTION π
so the acl_to_any_text() function takes the ACL that acl points at and translates it into a NULL terminated character string. iconic behavior fr fr. this string is built out of the ACL entries sitting inside acl, in the entry text format that acl(5) describes. entries get separated from each other by the separator character. and if prefix is not (const char *)NULL, then every single entry gets that character string stuck on the front of it. slay. β¨
if options is 0, the ACL entries get converted using the entry tag type keywords user, group, mask, and other. user IDs and group IDs of ACL entries that carry those qualifiers get converted to their matching names β and if an identifier has no corresponding name, you just get a decimal number string instead. no cap. the ACL text representation contains no additional comments. periodt.
but you can also bitwise-combine these options to change up the result:
TEXT_ABBREVIATEβ instead of spelling out the full tag type keywords, you get single letter abbreviations. the abbreviation foruserisu, the abbreviation forgroupisg, the abbreviation formaskism, and the abbreviation forotheriso. short queen energy. πTEXT_NUMERIC_IDSβ user IDs and group IDs get included as decimal numbers instead of names.TEXT_SOME_EFFECTIVEβ a comment containing the effective permissions of the ACL entry gets included after ACL entries that have permissions which are ineffective because they're masked by anACL_MASKentry. the ACL entry and the comment are separated by a tab character.TEXT_ALL_EFFECTIVEβ a comment containing the effective permissions of the ACL entry gets included after all ACL entries that are affected by anACL_MASKentry. and it's included even if the permissions in the ACL entry equal the effective permissions. again, the ACL entry and the comment are separated by a tab character.TEXT_SMART_INDENTβ this one only makes sense used in combination with theTEXT_SOME_EFFECTIVEorTEXT_ALL_EFFECTIVEoption. it increases the number of tab characters inserted between the ACL entry and the comment so that the comment lines up with the fourth tab stop position. a tab width of 8 characters is assumed. aesthetic alignment, we love to see it. π
the ACL that acl refers to is not changed. promise. π«Ά
this function allocates whatever memory it needs to hold the string and returns a pointer to the string. when you're done with that new string, you the caller should free any releasable memory by calling acl_free() with the (void*)char returned by acl_to_any_text() as the argument. don't be a memory leaker bestie. π
β RETURN VALUE β
on success, this function returns a pointer to the text representation of the ACL. on error, you get a value of (char *)NULL, and errno gets set appropriately. rude but fair.
π ERRORS π
if any of these conditions happen, the acl_to_any_text() function returns a value of (char *)NULL and sets errno to the corresponding value:
[EINVAL]β the argumentaclis not a valid pointer to an ACL.
and also: the ACL referenced by acl contains one or more improperly formed ACL entries, or for some other reason cannot be translated into the text form of an ACL. π
[ENOMEM]β the character string to be returned requires more memory than is allowed by the hardware or system-imposed memory management constraints. no room, no vibes.
π STANDARDS π
this is a non-portable, Linux specific extension to the ACL manipulation functions defined in IEEE Std 1003.1e draft 17 ("POSIX.1e", abandoned). yes, abandoned β iconic, honestly. π«Ά
π SEE ALSO π
acl_from_text(3), acl_to_text(3), acl_free(3), acl(5)
π AUTHOR π
written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>. thank you for your service king. π«‘
and that's the whole page bestie β Linux ACL, page ACL_TO_ANY_TEXT(3), dated March 25, 2002. old but gold, fr fr. go forth and convert those ACLs. πβ¨π
π¦ where this page comes from
- alpine 3.22: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.23: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.24: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- arch rolling: acl 2.4.0-1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- centos-stream 10: libacl-devel 2.4.0-2.el10 Β· LGPL-2.1-or-later
- centos-stream 9: libacl-devel 2.4.0-2.el9 Β· LGPLv2+
- centos-stream 9: libacl-devel 2.4.0-2.el9 Β· LGPLv2+
- debian bookworm: libacl1-dev 2.3.1-3
- debian trixie: libacl1-dev 2.3.2-2+b1
- fedora 43: libacl-devel 2.3.2-4.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.3.2-4.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.4.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.4.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.3.2-6.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.3.2-6.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.4.0-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.4.0-1.fc44 Β· LGPL-2.1-or-later
- nixpkgs unstable: acl 2.4.0
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu jammy: libacl1-dev 2.3.1-1
- ubuntu noble: libacl1-dev 2.3.2-1build1
- ubuntu noble: libacl1-dev 2.3.2-1build1.1
- ubuntu resolute: libacl1-dev 2.3.2-2
- ubuntu stonking: libacl1-dev 2.4.0-1
- (C) 2002 Andreas Gruenbacher, <andreas.gruenbacher@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms