ACL_DELETE_DEF_FILE(3)
π ACL_DELETE_DEF_FILE(3) π
okay so bestie, welcome to the Linux Access Control Lists library page for acl_delete_def_file and acl_delete_def_file_at β this is section 3 of the Library Functions Manual, and we're about to delete a default ACL by filename. yes, by filename. slay. π
β¨ NAME β¨
acl_delete_def_file, acl_delete_def_file_at β delete a default ACL by filename
π LIBRARY π
Linux Access Control Lists library (libacl, -lacl).
π«Ά SYNOPSIS π«Ά
#include <sys/types.h>
#include <sys/acl.h>
int
acl_delete_def_file(const char *path_p);
int
acl_delete_def_file_at(int dirfd, const char *path_p, int at_flags);
πΈ DESCRIPTION πΈ
so the acl_delete_def_file() function deletes a default ACL from the directory whose pathname you hand it in path_p. and listen β if path_p is a symbolic link, acl_delete_def_file() operates on the directory the link refers to. it dereferences, it doesn't get shy about it. π¦
now the permission vibe check: the effective user ID of the process must match the owner of the file or directory, OR the process must have the CAP_FOWNER capability, for the request to succeed. no cap. that's the rule. π
if path_p is not a directory, the function just fails. periodt. but here's the cute part: it is no error if the directory pointed to by path_p doesn't even have a default ACL. so deleting something that isn't there? totally fine, we move on, we don't stress. π
π§ acl_delete_def_file_at() π§
acl_delete_def_file_at() operates in exactly the same way as acl_delete_def_file(), except for the differences described right here:
- If the pathname given in
path_pis relative, then it's interpreted relative to the directory referred to by the file descriptordirfdβ rather than relative to the current working directory of the calling process, which is whatacl_delete_def_file()does. different starting point, same energy. π - If
path_pis relative anddirfdis the special valueAT_FDCWD, thenpath_pis interpreted relative to the current working directory of the calling process (likeacl_delete_def_file()does). okay so sometimes it's the same, we love consistency. β¨ - If
path_pis absolute, thendirfdis ignored. sorrydirfd, not your moment. π
The at_flags argument can either be 0, or include one or more of the following flags ORed together:
AT_EMPTY_PATHβ Ifpath_pis an empty string, operate on the file referred to bydirfd(which may have been obtained using theopen(2)O_PATHflag). In this case,dirfdcan refer to any type of file, not just a directory. so flexible, so iconic. πAT_SYMLINK_NOFOLLOWβ Ifpath_prefers to a symbolic link, do not dereference it: instead, fail the operation and set the global variableerrnotoENOTSUP. This indicates that the symbolic link cannot have ACLs. ngl it's giving "sorry babe, symlinks can't hold ACLs". π
β RETURN VALUE β
The acl_delete_def_file() and acl_delete_def_file_at() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. 0 = slay, -1 = check errno, bestie. π
π ERRORS π
If any of the following conditions occur, the acl_delete_def_file() and acl_delete_def_file_at() functions return the value -1 and set errno to the corresponding value:
[EBADF]β The argumentpath_pis relative but the argumentdirfdis neitherAT_FDCWDnor a valid file descriptor.[EINVAL]β The file referred to bypath_pis not a directory.- An invalid flag was specified in the
at_flagsargument.
- An invalid flag was specified in the
[ENOTDIR]β A component of the path prefix is not a directory.- The argument
path_pis relative and the argumentdirfdis a file descriptor referring to a file other than a directory.
- The argument
[ENOTSUP]β The argumentat_flagsincludes the flagAT_SYMLINK_NOFOLLOWandpath_pis a symbolic link.- The file system on which the file identified by
path_pis located does not support ACLs, or ACLs are disabled.
- The file system on which the file identified by
[EPERM]β The process does not have appropriate privilege to perform the operation to delete the default ACL.[EROFS]β This function requires modification of a file system which is currently read-only.
π STANDARDS π
IEEE Std 1003.1e draft 17 (βPOSIX.1eβ, abandoned)
Function acl_delete_def_file_at() is a Linux specific extension.
π SEE ALSO π
acl_get_file(3), acl_set_file(3), acl(5)
π 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 legends, we owe you everything π«Ά
and that's the whole page, bestie!! πΈ this came from the Linux ACL manual, dated June 5, 2026, and it lives at ACL_DELETE_DEF_FILE(3). go forth and delete those default ACLs responsibly, mwah π
β¨
π¦ where this page comes from
- 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+
- 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.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 stonking: libacl1-dev 2.4.0-1
- (C) 2002-2026 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