]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Monitor: use session's entity name for audit log 2944/head
authorJoao Eduardo Luis <joao@redhat.com>
Fri, 14 Nov 2014 21:10:28 +0000 (21:10 +0000)
committerJoao Eduardo Luis <joao@redhat.com>
Mon, 17 Nov 2014 15:40:55 +0000 (15:40 +0000)
Fixes: #9913
Backport: giant

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index f4188024fdc5434055554db3f51d181b12bf1dda..4c01800057d7ccd7934e814d4d0c09358cd4fa99 100644 (file)
@@ -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);
index da1fd0a5eb194b7c204a8e01f8d6f87a94acb7ff..d60d46dfabb79264ff64a50fcdc3bba4036a2015 100644 (file)
@@ -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 ";
           }