diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-21 02:27:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-21 02:27:49 +0000 |
commit | 7a34f7a30b4a4e8efeac9ba420466271ccbd41ef (patch) | |
tree | 9dd853fa51de7b429a5e7aa64a2f640d30506378 /src/mds/MDSAuthCaps.h | |
parent | Releasing progress-linux version 18.2.3-0progress7.99u1. (diff) | |
download | ceph-7a34f7a30b4a4e8efeac9ba420466271ccbd41ef.tar.xz ceph-7a34f7a30b4a4e8efeac9ba420466271ccbd41ef.zip |
Merging upstream version 18.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/mds/MDSAuthCaps.h')
-rw-r--r-- | src/mds/MDSAuthCaps.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mds/MDSAuthCaps.h b/src/mds/MDSAuthCaps.h index bbb2589b3..f77fd965a 100644 --- a/src/mds/MDSAuthCaps.h +++ b/src/mds/MDSAuthCaps.h @@ -146,6 +146,10 @@ struct MDSCapMatch { */ bool match_path(std::string_view target_path) const; + bool match_fs(std::string_view target_fs) const { + return fs_name == target_fs || fs_name.empty() || fs_name == "*"; + } + void encode(ceph::buffer::list& bl) const { ENCODE_START(1, 1, bl); encode(uid, bl); @@ -261,8 +265,7 @@ public: } for (const MDSCapGrant &g : grants) { - if (g.match.fs_name == fs_name || g.match.fs_name.empty() || - g.match.fs_name == "*") { + if (g.match.match_fs(fs_name)) { if (mask & MAY_READ && g.spec.allow_read()) { return true; } @@ -285,10 +288,12 @@ public: } } - bool root_squash_in_caps() const { - for (const MDSCapGrant &g : grants) { - if (g.match.root_squash) { - return true; + bool root_squash_in_caps(std::string_view fs_name) const { + for (const MDSCapGrant& g : grants) { + if (g.match.match_fs(fs_name)) { + if (g.match.root_squash) { + return true; + } } } return false; |