ACL_FROM_MODE(3)
π ACL_FROM_MODE(3) π
okay bestie, so this one is acl_from_mode from the Library Functions Manual β it lives in section 3, it's the lil glow-up function that turns boring old file permission bits into a whole entire ACL. no cap.
β¨ NAME β¨
acl_from_mode β create an ACL from file permission bits π
π LIBRARY π
Linux Access Control Lists library (that's libacl, and you link it with -lacl) π¦
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <acl/libacl.h>
acl_t
acl_from_mode(mode_t mode);
π DESCRIPTION π
So the acl_from_mode() function creates a minimal ACL, and when I say minimal I mean it is giving bare minimum, it has literally just three entries:
- one with tag type
ACL_USER_OBJ - one with tag type
ACL_GROUP_OBJ - one with tag type
ACL_OTHER
and the permissions on those entries correspond to the owner, group, and other permission bits of its argument mode. that's it. that's the whole function. iconic behaviour honestly π
β RETURN VALUE β
On success, this function returns a pointer to the working storage. π«Ά
On error, a value of (acl_t)NULL is returned, and errno is set appropriately. sad girl hours π
π ERRORS π
If any of the following conditions occur, the acl_from_mode() function returns a value of (acl_t)NULL and sets errno to the corresponding value:
[ENOMEM]β the ACL working storage requires more memory than is allowed by the hardware or system-imposed memory management constraints. (she's asking for too much and the system said no π)
π 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 bestie, abandoned. we don't talk about it. π
π₯ SEE ALSO π₯
π AUTHOR π
Written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>. thank you king π
and that's the whole page, bestie β from Linux ACL, dated March 23, 2002, and it's the ACL_FROM_MODE(3) page. go forth and make minimal ACLs, ily, mwah ππ§πΈ
π¦ 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