From: John Spray Date: Tue, 13 Oct 2015 10:12:54 +0000 (+0100) Subject: mds: reject client sessions with bad root metadata X-Git-Tag: v10.0.3~48^2~4^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b7a8b23b380b9fb00a354b52aba33e94334b423;p=ceph.git mds: reject client sessions with bad root metadata ...instead of just purging the bad metadata, prevent the client from opening the session. Signed-off-by: John Spray --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 2616a251d632..62cf62f1b280 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -287,7 +287,13 @@ void Server::handle_client_session(MClientSession *m) if (!session->auth_caps.path_capable(claimed_root)) { derr << __func__ << " forbidden path claimed as mount root: " << claimed_root << " by " << m->get_source() << dendl; - session->info.client_metadata.erase("root"); + // Tell the client we're rejecting their open + mds->send_message_client(new MClientSession(CEPH_SESSION_REJECT), session); + mds->clog->warn() << "client session with invalid root '" << + claimed_root << "' denied (" << session->info.inst << ")"; + session->clear(); + // Drop out; don't record this session in SessionMap or journal it. + break; } }