From f5dbdedcc53d2c57b9ddecbe9248c90ef0fa08d6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 15 Jul 2024 19:03:17 -0700 Subject: Update from Gnulib by running admin/merge-gnulib --- lib/qcopy-acl.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'lib/qcopy-acl.c') diff --git a/lib/qcopy-acl.c b/lib/qcopy-acl.c index dfc39cead05..877f42588b7 100644 --- a/lib/qcopy-acl.c +++ b/lib/qcopy-acl.c @@ -26,6 +26,20 @@ #if USE_XATTR # include +# include + +# if HAVE_LINUX_XATTR_H +# include +# endif +# ifndef XATTR_NAME_NFSV4_ACL +# define XATTR_NAME_NFSV4_ACL "system.nfs4_acl" +# endif +# ifndef XATTR_NAME_POSIX_ACL_ACCESS +# define XATTR_NAME_POSIX_ACL_ACCESS "system.posix_acl_access" +# endif +# ifndef XATTR_NAME_POSIX_ACL_DEFAULT +# define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default" +# endif /* Returns 1 if NAME is the name of an extended attribute that is related to permissions, i.e. ACLs. Returns 0 otherwise. */ @@ -33,7 +47,12 @@ static int is_attr_permissions (const char *name, struct error_context *ctx) { - return attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS; + /* We need to explicitly test for the known extended attribute names, + because at least on CentOS 7, attr_copy_action does not do it. */ + return strcmp (name, XATTR_NAME_POSIX_ACL_ACCESS) == 0 + || strcmp (name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0 + || strcmp (name, XATTR_NAME_NFSV4_ACL) == 0 + || attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS; } #endif /* USE_XATTR */ -- cgit v1.2.1