ACL_CREATE_ENTRY(3)
β¨ NAME β¨
acl_create_entry β bestie, we're making a brand new ACL entry π
π LIBRARY π
Linux Access Control Lists library, aka libacl, link it with -lacl and you're good π«Ά
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <sys/acl.h>
int
acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p);
π DESCRIPTION π
okay so. acl_create_entry() makes a whole new ACL entry inside the ACL that the pointer argument acl_p points to. and like, when it works? it hands you back a descriptor for that shiny new entry through entry_p. iconic behavior tbh β¨
β οΈ heads up: this function may cause memory to be allocated. that's the vibe, that's the cost.
so the caller should free any releasable memory once the new ACL isn't needed anymore β do that by calling acl_free(3) with (void*)*acl_p as the argument. no leaks, we don't do that here π
and here's the lowkey important part: if the ACL working storage cannot be increased in its current location, then the working storage for the ACL pointed to by acl_p may get relocated, and the previous working storage is released. a pointer to the new working storage comes back to you via acl_p. so yeah, don't go clutching that old pointer, it's giving ex-energy π
π how the new entry starts out π
the components of the new ACL entry get initialized like this:
- the ACL tag type component contains
ACL_UNDEFINED_TAG - the qualifier component contains
ACL_UNDEFINED_ID - the set of permissions has no permissions enabled
and any existing ACL entry descriptors that refer to entries in the ACL? they continue to refer to those entries. no chaos, no shuffling, everyone keeps their seat πͺ
β RETURN VALUE β
- it returns the value
0if it's successful π - otherwise the value
-1is returned, and the global variableerrnois set to indicate the error π
π₯ ERRORS π₯
if any of these conditions occur, acl_create_entry() returns -1 and sets errno to the corresponding value:
[EINVAL]β the argumentacl_pis not a valid pointer to an ACL. like bestie, that's not an ACL, that's a vibe check you failed π[ENOMEM]β the ACL working storage requires more memory than is allowed by the hardware or system-imposed memory management constraints. the machine said "no more" and honestly? same π«
π STANDARDS π
IEEE Std 1003.1e draft 17 (βPOSIX.1eβ, abandoned)
yeah, abandoned. not our fault, we just work here π but she still slays.
π SEE ALSO π
(yes, acl_create_entry(3) is listed in its own SEE ALSO. self-love, we respect it π
)
π¦ 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 legends π«Άβ¨
Linux ACL Β· March 23, 2002 Β· ACL_CREATE_ENTRY(3)
okay that's the whole page bestie, go create some entries, hydrate, and remember: acl_free(3) is not optional ππΈβ¨π
π¦ 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