ACL_DELETE_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_DELETE_ENTRY(3) πŸ’–

okay bestie, so this one is acl_delete_entry from the Linux Access Control Lists library, and it lives in the Library Functions Manual section 3. yeah. she's a libacl girlie. let's get into it πŸŽ€


✨ NAME ✨

acl_delete_entry β€” delete an ACL entry. that's it. that's the whole job. she removes one entry. no cap. πŸ’…


πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library β€” aka libacl, and you link her with -lacl. mwah. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

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

int
acl_delete_entry(acl_t acl, acl_entry_t entry_d);

look at her. two includes, one function, zero drama. iconic. ✨


🌸 DESCRIPTION 🌸

so here's the tea, bestie: acl_delete_entry() removes the ACL entry indicated by the entry_d descriptor from the ACL pointed to by acl. one entry. poof. gone. πŸ™ˆ

now the important part, because this is where people get confused and I need you to lock in πŸ”₯ β€” any existing ACL entry descriptors that refer to entries in acl other than the one referred to by entry_d continue to refer to the same entries. so like, the other descriptors are fine, they didn't do anything wrong, they're still valid, they still point where they always pointed.

but listen πŸ‘‡

the argument entry_d and any other ACL entry descriptors that refer to the same ACL entry are undefined after this function completes. like, they're not "invalid" in a cute recoverable way, they're straight-up undefined. don't touch them. don't look at them. let them go. πŸ’€

and finally: any existing ACL pointers that refer to the ACL referred to by acl continue to refer to the ACL. the ACL itself is still there, still valid, just with one less entry in it. she's fine. she's thriving. she's just smaller now. πŸ‘‘


πŸŽ€ RETURN VALUE πŸŽ€

acl_delete_entry() returns the value 0 if successful πŸŽ‰

otherwise, the value -1 is returned and the global variable errno is set to indicate the error. so like, if it's not 0, check your errno, bestie, she's telling you what went wrong. 😭


πŸ’œ ERRORS πŸ’œ

if any of the following conditions occur, the acl_delete_entry() function returns -1 and sets errno to the corresponding value:

  • [EINVAL] β€” The argument acl_p is not a valid pointer to an ACL.
    • The argument entry_d is not a valid pointer to an ACL entry.

(yes, the manpage really says acl_p there even though the parameter is called acl. I'm not changing it. that's what she says. I don't make the rules. πŸ“)


⭐ STANDARDS ⭐

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

yeah. abandoned. the whole standard just got up and left. but we still out here using the API, so. 🀷


πŸ‘€ SEE ALSO πŸ‘€

go read those too, they're all part of the same friend group 🧚


πŸ’Œ 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, legends πŸ«‘πŸ’–


and that's the whole page, bestie!! this was Linux ACL, dated March 23, 2002, and she's still out here deleting ACL entries like the main character she is. go forth and acl_delete_entry responsibly. undefined descriptors are NOT your friend. periodt. πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from