From 4957eb32c34c4ae6f481c96fbd078cdd7e91caa6 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Thu, 1 Aug 2024 22:16:00 +0530 Subject: [PATCH] client: Fix the multifs auth caps check 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 (cherry picked from commit b1d6bb95d3c805af37883ef481b96a1aa33cedf0) (cherry picked from commit cac4ee5d1a5e769c6bf90619d93043ade15fc27b) --- src/client/Client.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 58f88477ad3..86db627617b 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5919,11 +5919,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; -- 2.39.5