ACL_DUP(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_DUP(3) πŸ’–

okay bestie, welcome to the acl_dup page β€” it's a Library Functions Manual situation and honestly? it's giving short and sweet. no notes. πŸŽ€


✨ NAME ✨

acl_dup β€” duplicate an ACL πŸ¦‹


πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library β€” that's libacl, and you link it with -lacl. periodt. πŸ’…


🌸 SYNOPSIS 🌸

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

acl_t
acl_dup(acl_t acl);

πŸ’« DESCRIPTION πŸ’«

so here's the whole vibe: acl_dup() hands you back a pointer to a copy of the ACL that acl points to. that's it. that's the function. iconic behavior fr fr. πŸ‘‘

but lowkey important β€” this function may cause memory to be allocated. so the caller (that's you, bestie 🫢) should free any releasable memory once the new ACL is no longer required, by calling acl_free(3) with the (void*)acl_t returned by acl_dup() as an argument. don't just leave it sitting there, that's not the move. 😭


πŸŽ€ RETURN VALUE πŸŽ€

  • on success, this function returns a pointer to the working storage. slay. ✨
  • on error, a value of (acl_t)NULL is returned, and errno is set appropriately. πŸ’€

πŸ”₯ ERRORS πŸ”₯

if any of these conditions happen, acl_dup() returns (acl_t)NULL and sets errno to the matching value:

  • [EINVAL] β€” the argument acl is not a valid pointer to an ACL. girl. that's not a real ACL. πŸ™ˆ
  • [ENOMEM] β€” the acl_t to be returned requires more memory than is allowed by the hardware or system-imposed memory management constraints. the memory said no. 😭

🌈 STANDARDS 🌈

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

not me telling you it's abandoned β€” yes bestie, POSIX.1e draft 17 really did get left on read. still the standard this thing references though. πŸ’€

πŸ‘€ 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>. thank you for your service, kings. 🫢


and that's the whole page!! this one's from the Linux ACL crew, dated March 23, 2002 β€” yes it's an elder but it ate and it's still serving. go free your memory. mwah. πŸ’…πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from