summaryrefslogtreecommitdiffstats
path: root/src/mds/Server.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-21 02:27:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-21 02:27:49 +0000
commit7a34f7a30b4a4e8efeac9ba420466271ccbd41ef (patch)
tree9dd853fa51de7b429a5e7aa64a2f640d30506378 /src/mds/Server.cc
parentReleasing progress-linux version 18.2.3-0progress7.99u1. (diff)
downloadceph-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/Server.cc')
-rw-r--r--src/mds/Server.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 48e7b03ae..2f8b376ce 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -717,16 +717,10 @@ void Server::handle_client_session(const cref_t<MClientSession> &m)
break;
}
- if (session->auth_caps.root_squash_in_caps() && !client_metadata.features.test(CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK)) {
- CachedStackStringStream css;
- *css << "client lacks CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK needed to enforce 'root_squash' MDS auth caps";
- send_reject_message(css->strv());
- mds->clog->warn() << "client session (" << session->info.inst
- << ") lacks CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK "
- << " needed to enforce 'root_squash' MDS auth caps";
- session->clear();
- break;
-
+ std::string_view fs_name = mds->mdsmap->get_fs_name();
+ bool client_caps_check = client_metadata.features.test(CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK);
+ if (session->auth_caps.root_squash_in_caps(fs_name) && !client_caps_check) {
+ mds->sessionmap.add_to_broken_root_squash_clients(session);
}
// Special case for the 'root' metadata path; validate that the claimed
// root is actually within the caps of the session
@@ -1573,11 +1567,10 @@ void Server::handle_client_reconnect(const cref_t<MClientReconnect> &m)
*css << "missing required features '" << missing_features << "'";
error_str = css->strv();
}
- if (session->auth_caps.root_squash_in_caps() &&
- !session->info.client_metadata.features.test(CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK)) {
- CachedStackStringStream css;
- *css << "client lacks CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK needed to enforce 'root_squash' MDS auth caps";
- error_str = css->strv();
+ std::string_view fs_name = mds->mdsmap->get_fs_name();
+ bool client_caps_check = session->info.client_metadata.features.test(CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK);
+ if (session->auth_caps.root_squash_in_caps(fs_name) && !client_caps_check) {
+ mds->sessionmap.add_to_broken_root_squash_clients(session);
}
}