]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Add exception to POSIX ACL xattrs in removexattr 55803/head
authorAnoop C S <anoopcs@cryptolab.net>
Mon, 8 Jan 2024 11:47:59 +0000 (17:17 +0530)
committerAnoop C S <anoopcs@cryptolab.net>
Wed, 28 Feb 2024 06:20:50 +0000 (11:50 +0530)
With an exception to POSIX ACL xattrs all others from "system."
namespace are found to return ENOTSUP during a removal attempt.
Hence "system.posix_acl_access" and "system.posix_acl_default"
are exempted thereby returning success despite their presence
on files.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
(cherry picked from commit a17dccebba0fbc46ac0d3d57fca3f671b6a99bec)

src/client/Client.cc

index 2e099f26e6845bc724f4ba964b14d748ade87a94..1d3d019b72e3e77ed213960495e726bacc3e0aad 100644 (file)
@@ -13312,7 +13312,9 @@ int Client::_removexattr(Inode *in, const char *name, const UserPerm& perms)
   if (strncmp(name, "user.", 5) &&
       strncmp(name, "security.", 9) &&
       strncmp(name, "trusted.", 8) &&
-      strncmp(name, "ceph.", 5))
+      strncmp(name, "ceph.", 5) &&
+      strcmp(name, ACL_EA_ACCESS) &&
+      strcmp(name, ACL_EA_DEFAULT))
     return -CEPHFS_EOPNOTSUPP;
 
   const VXattr *vxattr = _match_vxattr(in, name);
@@ -13328,6 +13330,11 @@ int Client::_removexattr(Inode *in, const char *name, const UserPerm& perms)
  
   int res = make_request(req, perms);
 
+  if ((!strcmp(name, ACL_EA_ACCESS) ||
+      !strcmp(name, ACL_EA_DEFAULT)) &&
+      res == -CEPHFS_ENODATA)
+    res = 0;
+
   trim_cache();
   ldout(cct, 8) << "_removexattr(" << in->ino << ", \"" << name << "\") = " << res << dendl;
   return res;