]> Savannah Git Hosting - gnulib.git/commit
file-has-acl: port to Fedora 39
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 12 May 2023 18:56:17 +0000 (11:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 12 May 2023 18:56:53 +0000 (11:56 -0700)
commitb851a965da62cd858d71b2e5a7261a211f00b297
tree15702b28dd50bed3b7c4a59071d0cb5dfc5f65e0
parentdfdf33a46655eea91ce0a7db5821cb99dd985c05
file-has-acl: port to Fedora 39

Fedora 39 getxattr with XATTR_NAME_POSIX_ACL_ACCESS either
succeeds or fails with ENODATA, so it is no longer possible to
detect from its failure that the filesystem might support NFSv4 ACLs.
Problem reported by Ondrej Valousek in:
https://lists.gnu.org/r/bug-gnulib/2023-04/msg00228.html
Instead, use listxattr to determine whether NFSv4 ACLs are in play.
This typically saves syscalls anyway.
* lib/file-has-acl.c: In #if, use (HAVE_LINUX_XATTR_H &&
HAVE_LISTXATTR) instead of GETXATTR_WITH_POSIX_ACLS.
The following changes apply when (USE_ACL && HAVE_LINUX_XATTR_H &&
HAVE_LISTXATTR):
Include minmax.h.
(have_xattr): New function.
(file_has_acl): Try listxattr first; typically this means we need
to do no other syscall.  Call getxattr only if there are NFSv4
ACLs but not POSIX ACLs.
* m4/acl.m4 (gl_FILE_HAS_ACL): Simplify by merely testing for
linux/xattr.h and listxattr.  All uses changed.
ChangeLog
lib/file-has-acl.c
m4/acl.m4