]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Fix the multifs auth caps check
authorKotresh HR <khiremat@redhat.com>
Thu, 1 Aug 2024 16:46:00 +0000 (22:16 +0530)
committerKotresh HR <khiremat@redhat.com>
Thu, 17 Jul 2025 06:46:28 +0000 (06:46 +0000)
The fsname needs to be passed to validate the mds
auth caps check. This patch fixes the same.

Fixes: https://tracker.ceph.com/issues/72167
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/client/Client.cc

index c57e282ca6b21408ea319704e93fc9053026262d..df17fe9ccd14dcd236e7121db56a03544c5b2e12 100644 (file)
@@ -6088,11 +6088,12 @@ int Client::mds_check_access(std::string& path, const UserPerm& perms, int mask)
     path = path.substr(1);
   }
 
+  std::string_view fs_name = mdsmap->get_fs_name();
   for (auto& s: cap_auths) {
-    ldout(cct, 20) << __func__ << " auth match path " << s.match.path << " r: " << s.readable
-                   << " w: " << s.writeable << dendl;
+    ldout(cct, 20) << __func__ << " auth match fsname " << s.match.fs_name << " auth match path "
+                   << s.match.path << " r: " << s.readable << " w: " << s.writeable << dendl;
     ldout(cct, 20) << " match.uid " << s.match.uid << dendl;
-    if (s.match.match(path, perms.uid(), perms.gid(), &gid_list)) {
+    if (s.match.match(fs_name, path, perms.uid(), perms.gid(), &gid_list)) {
       ldout(cct, 20) << " is matched" << dendl;
       // always follow the last auth caps' permision
       root_squash_perms = true;