From d8a7db889a14892eaaf8512d211959f49df6535b Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Fri, 14 Nov 2014 21:10:28 +0000 Subject: [PATCH] mon: Monitor: use session's entity name for audit log Fixes: #9913 Backport: giant Signed-off-by: Joao Eduardo Luis --- src/mon/Monitor.cc | 11 ++++------- src/mon/Monitor.h | 7 +------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index f4188024fdc54..4c01800057d7c 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2430,19 +2430,16 @@ void Monitor::handle_command(MMonCommand *m) dout(1) << __func__ << " access denied" << dendl; (cmd_is_rw ? audit_clog->info() : audit_clog->debug()) << "from='" << session->inst << "' " - << "entity='" << session->auth_handler->get_entity_name() - << "' cmd=" << m->cmd << ": access denied"; + << "entity='" << session->entity_name << "' " + << "cmd=" << m->cmd << ": access denied"; reply_command(m, -EACCES, "access denied", 0); return; } (cmd_is_rw ? audit_clog->info() : audit_clog->debug()) << "from='" << session->inst << "' " - << "entity='" - << (session->auth_handler ? - stringify(session->auth_handler->get_entity_name()) - : "forwarded-request") - << "' cmd=" << m->cmd << ": dispatch"; + << "entity='" << session->entity_name << "' " + << "cmd=" << m->cmd << ": dispatch"; if (module == "mds" || module == "fs") { mdsmon()->dispatch(m); diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index da1fd0a5eb194..d60d46dfabb79 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -737,12 +737,7 @@ public: // if client drops we may not have a session to draw information from. if (s) { ss << "from='" << s->inst << "' " - << "entity='"; - if (s->auth_handler) - ss << s->auth_handler->get_entity_name(); - else - ss << "forwarded-request"; - ss << "' "; + << "entity='" << s->entity_name << "' "; } else { ss << "session dropped for command "; } -- 2.39.5