From b851a965da62cd858d71b2e5a7261a211f00b297 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 12 May 2023 11:56:17 -0700 Subject: 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 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 7d99b6f4cc..169645e055 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2023-05-12 Paul Eggert + + 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. + 2023-05-10 Josh Soref bootstrap: spelling/grammar fix in comment -- cgit v1.2.1