]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: use session_info_t socket inst for addr
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 2 Aug 2019 20:28:35 +0000 (13:28 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 13 Sep 2019 00:42:03 +0000 (17:42 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDSDaemon.cc
src/mds/SessionMap.cc
src/mds/SessionMap.h

index 1f72712239fee13bf78f82d79b4b373f34d39c25..1795d2d18f3f3318e9aa5fe586bb8fd104fa3e55 100644 (file)
@@ -1220,9 +1220,6 @@ void MDSDaemon::ms_handle_accept(Connection *con)
   // request to open a session (initial state of Session is `closed`)
   if (!s) {
     s = new Session(con);
-    s->info.auth_name = con->get_peer_entity_name();
-    s->info.inst.addr = con->get_peer_socket_addr();
-    s->info.inst.name = n;
     dout(10) << " new session " << s << " for " << s->info.inst
             << " con " << con << dendl;
     con->set_priv(RefCountedPtr{s, false});
index a7bb216b6133b58a5471a7957e9183541be8c639..d70599e40d0b9abd891ff2a95f82c66497875227 100644 (file)
@@ -1001,7 +1001,7 @@ int Session::check_access(CInode *in, unsigned mask,
   if (!auth_caps.is_capable(path, in->inode.uid, in->inode.gid, in->inode.mode,
                            caller_uid, caller_gid, caller_gid_list, mask,
                            new_uid, new_gid,
-                           socket_addr)) {
+                           info.inst.addr)) {
     return -EACCES;
   }
   return 0;
index 61ca7aeb4845246144ee5f557743f22b4895ee8b..4d57f4b0c14e24d83df650154807d6b4c3c31ba2 100644 (file)
@@ -172,7 +172,6 @@ public:
 protected:
   ConnectionRef connection;
 public:
-  entity_addr_t socket_addr;
   xlist<Session*>::item item_session_list;
 
   list<ref_t<Message>> preopen_out_queue;  ///< messages for client, queued before they connect
@@ -422,8 +421,11 @@ public:
 
   void set_connection(ConnectionRef con) {
     connection = std::move(con);
-    if (connection) {
-      socket_addr = connection->get_peer_socket_addr();
+    auto& c = connection;
+    if (c) {
+      info.auth_name = c->get_peer_entity_name();
+      info.inst.addr = c->get_peer_socket_addr();
+      info.inst.name = entity_name_t(c->get_peer_type(), c->get_peer_global_id());
     }
   }
   const ConnectionRef& get_connection() const {