ACL_COPY_EXT(3)
β¨ ACL_COPY_EXT(3) β¨
okay bestie, we're doing a deep dive on acl_copy_ext from the Linux Access Control Lists library (that's libacl, link it with -lacl π
). this is a Library Functions Manual situation and honestly? it's giving β¨pointer energyβ¨. let's go π¦
πΈ NAME πΈ
acl_copy_ext β copy an ACL from internal to external representation
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl).
π SYNOPSIS π
#include <sys/types.h>
#include <sys/acl.h>
ssize_t
acl_copy_ext(void *buf_p, acl_t acl, ssize_t size);
β¨ DESCRIPTION β¨
so here's the tea π: acl_copy_ext() takes the ACL that acl points to and copies it from system-managed space into the user-managed space that buf_p points at. it's literally a glow-up transformation from internal to external form.
the size parameter is the size in bytes of the buffer that buf_p points to, bestie. don't be sloppy with it.
now the format of the ACL that lands in buf_p? it's a contiguous, persistent data item β and the format itself is unspecified. iykyk. it's not for you to poke at, it's for you to hand back to the library later. π
β οΈ it is your responsibility (yes, the invoker's, that's you) to allocate an area big enough to hold the copied ACL. don't come crying to me if your buffer is too small, the library will simply not have a good time.
want to know how big that exportable, contiguous, persistent form actually is? call acl_size() first, babe. that's the vibe check before the main character moment. π
one more thing that's lowkey important: any ACL entry descriptors that refer to an entry in the ACL referenced by acl continue to refer to those entries. and any existing ACL pointers that refer to the ACL referenced by acl continue to refer to the ACL. nothing gets detached, nothing gets moved, we're just copying. no cap. π«Ά
π RETURN VALUE π
- on success, it returns the number of bytes placed in the buffer pointed to by
buf_p⨠- on error, a value of
(ssize_t)-1is returned anderrnois set appropriately π
π ERRORS π
if any of these conditions occur, acl_copy_ext() returns a value of (ssize_t)-1 and sets errno to the corresponding value:
[EINVAL]β a whole bundle of yikes, actually:- the
sizeparameter is zero or negative π - the argument
aclis not a valid pointer to an ACL π - the ACL referenced by
aclcontains one or more improperly formed ACL entries, or for some other reason cannot be translated into the external form of an ACL
- the
[ERANGE]β thesizeparameter is greater than zero but smaller than the length of the contiguous, persistent form of the ACL. so close yet so far, bestie π
β STANDARDS β
IEEE Std 1003.1e draft 17 (βPOSIX.1eβ, abandoned)
yes it says abandoned. we don't talk about that. π
π SEE ALSO π
π 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 came from the Linux ACL manual, dated March 23, 2002. iconic, historic, periodt. go forth and copy your ACLs responsibly πβ¨π¦
π¦ 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