ACL_GET(3)
π ACL_GET(3) β get an ACL for a file
okay bestie, welcome to ACL_GET(3) from the Library Functions Manual β¨ this is the Standard C Library (libc, -lc) page and it's genuinely one of those "small but mighty" ones. Let's get into it π«Ά
πΈ NAME
acl_get_fd, acl_get_fd_np, acl_get_file, acl_get_link_np β get an ACL for a file
π LIBRARY
Standard C Library (libc, -lc) π
β¨ SYNOPSIS
#include <sys/types.h>
#include <sys/acl.h>
acl_t
acl_get_fd(int fd);
acl_t
acl_get_fd_np(int fd, acl_type_t type);
acl_t
acl_get_file(const char *path_p, acl_type_t type);
acl_t
acl_get_link_np(const char *path_p, acl_type_t type);
π¦ DESCRIPTION
so acl_get_fd(), acl_get_file(), acl_get_link_np(), and acl_get_fd_np() each let you retrieve an ACL from a file. that's the whole vibe, one job, four flavours π
acl_get_fd()is the POSIX.1e call β it grabs an ACL of typeACL_TYPE_ACCESSfrom a file descriptor.acl_get_fd_np()is the non-portable form ofacl_get_fd()β the "np" literally means non-portable, iykyk β and it lets you retrieve any type of ACL from a file descriptor.acl_get_file()is the POSIX.1e call that retrieves a specified type of ACL from a file by name.acl_get_link_np()is the non-portable variation onacl_get_file()which does not follow a symlink if the target of the call is a symlink. iconic behaviour honestly, it just minds its own business π₯
β οΈ heads up bestie: these functions may cause memory to be allocated. the caller should free any releasable memory when the new ACL is no longer required, by callingacl_free(3)with the(void *)acl_tas an argument. don't ghost your allocations π
The ACL in the working storage is an independent copy of the ACL associated with the object referred to by fd. and likeβ¦ it's a copy for looking at only β the ACL in the working storage shall not participate in any access control decisions. it's giving spectator energy, not main character energy π
Valid values for the type argument are β memorise these, fr fr:
ACL_TYPE_ACCESSβ POSIX.1e access ACLACL_TYPE_DEFAULTβ POSIX.1e default ACLACL_TYPE_NFS4β NFSv4 ACL
The ACL returned will be branded accordingly. slay π
π§ IMPLEMENTATION NOTES
FreeBSD's support for POSIX.1e interfaces and features is still under development at this time. it's a work in progress bestie, be nice to it πΈ
π RETURN VALUES
Upon successful completion, the function shall return a pointer to the ACL that was retrieved π otherwise, a value of (acl_t)NULL shall be returned, and errno shall be set to indicate the error. sad girl hours π
π ERRORS
If any of the following conditions occur, the acl_get_fd() function shall return a value of (acl_t)NULL and set errno to the corresponding value:
[EACCES]β Search permission is denied for a component of the path prefix, or the object exists and the process does not have appropriate access rights.[EBADF]β Thefdargument is not a valid file descriptor.[EINVAL]β The ACL type passed is invalid for this file object.[ENAMETOOLONG]β A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.[ENOENT]β The named object does not exist, or thepath_pargument points to an empty string.[ENOMEM]β Insufficient memory available to fulfill request.[EOPNOTSUPP]β The file system does not support ACL retrieval.
π SEE ALSO
acl(3), acl_free(3), acl_get(3), acl_get_brand_np(3), acl_set(3), posix1e(3)
β STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17 π
π HISTORY
POSIX.1e support was introduced in FreeBSD 4.0. old money π
π AUTHORS
Robert N M Watson
and that's the whole page, bestie!! this one came from Debian, dated September 21, 2023 β go forth and retrieve those ACLs responsibly πβ¨π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2000, 2002 Robert N. M. Watson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms