From 5cf69712f239f1c759a3b009ea6ddb7047f9854e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 7 Aug 2018 12:51:37 -0500 Subject: [PATCH] mon/AuthMonitor: do not share monmap until authenticated Reported-by: Christopher Ryan Harrell Signed-off-by: Sage Weil --- src/mon/AuthMonitor.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index cfa55aa3febe3..039380f8c6c86 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -591,11 +591,6 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable) uint64_t auid = 0; if (start) { // new session - - // always send the latest monmap. - if (m->monmap_epoch < mon->monmap->get_epoch()) - mon->send_latest_monmap(m->get_connection().get()); - proto = s->auth_handler->start_session(entity_name, indata, response_bl, caps_info); ret = 0; if (caps_info.allow_all) { @@ -633,6 +628,10 @@ reply: reply = new MAuthReply(proto, &response_bl, ret, s->global_id); mon->send_reply(op, reply); if (finished) { + // always send the latest monmap. + if (m->monmap_epoch < mon->monmap->get_epoch()) + mon->send_latest_monmap(m->get_connection().get()); + mon->configmon()->check_sub(s); } done: -- 2.39.5