ACL_COPY_ENTRY(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_COPY_ENTRY(3) ✨

okay bestie, gather round, because today we're talking about acl_copy_entry from the Linux Access Control Lists library β€” that's libacl, link it with -lacl πŸŽ€. This is the library functions manual, and it's giving "small but mighty," fr fr.


🌸 NAME 🌸

acl_copy_entry β€” copy an ACL entry πŸ’…


πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library (libacl, -lacl) πŸ¦‹


🧚 SYNOPSIS 🧚

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

int
acl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d);

πŸ’– DESCRIPTION πŸ’–

okay so here's the vibe: acl_copy_entry() takes the contents of the ACL entry that src_d is pointing at, and copies all of it into the existing ACL entry that dest_d is pointing at. like, straight up duplicating the whole thing, no cap.

and here's the iconic part β€” src_d and dest_d can refer to entries in different ACLs. they do not have to be besties from the same ACL. cross-ACL copy? slay. πŸ’«


🫢 RETURN VALUE 🫢

  • acl_copy_entry() returns the value 0 if it worked. periodt, we love a success.
  • otherwise it returns -1, and the global variable errno gets set to tell you what went wrong 😭

πŸ’€ ERRORS πŸ’€

if any of these conditions happen, acl_copy_entry() returns -1 and sets errno to the matching value:

  • [EINVAL] β€” The argument src_d or dest_d is not a valid descriptor for an ACL entry.

The arguments src_d and dest_d reference the same ACL entry.

not me trying to copy an entry onto itself πŸ’€ yeah that's an [EINVAL], bestie, don't do it.

πŸ‘‘ STANDARDS πŸ‘‘

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


πŸ”₯ 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>. absolute legends, we stan 🫢


and that's the whole page, babes πŸ’– this came out of the Linux ACL docs, dated March 23, 2002 β€” yeah, it's vintage, but it still ate. mwah, go forth and copy those entries responsibly βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from