]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: authenticate ping sessions
authorSage Weil <sage@redhat.com>
Wed, 19 Sep 2018 16:35:42 +0000 (11:35 -0500)
committerSage Weil <sage@redhat.com>
Mon, 15 Oct 2018 20:01:40 +0000 (15:01 -0500)
Do not set up a Session object, though--nobody cares (currently!).

This avoids having to special-case the generic authorizer validation
code in msg/* to have to handle non-authenticated sessions.  Also, it
seems like a good idea to authenticate these sessions!

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.h

index c6b3faf5002b55da078f135bba34bfb4bc7039da..cdd920dd02e98d7690bc4f5cee0d93c55865f54b 100644 (file)
@@ -1631,12 +1631,12 @@ public:
     bool ms_can_fast_dispatch_any() const override { return true; }
     bool ms_can_fast_dispatch(const Message *m) const override {
       switch (m->get_type()) {
-       case CEPH_MSG_PING:
-       case MSG_OSD_PING:
-          return true;
-       default:
-          return false;
-       }
+      case CEPH_MSG_PING:
+      case MSG_OSD_PING:
+       return true;
+      default:
+       return false;
+      }
     }
     void ms_fast_dispatch(Message *m) override {
       osd->heartbeat_dispatch(m);
@@ -1654,6 +1654,13 @@ public:
     int ms_handle_authentication(Connection *con) override {
       return true;
     }
+    bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
+                          bool force_new) override {
+      return osd->ms_get_authorizer(dest_type, authorizer, force_new);
+    }
+    KeyStore *ms_get_auth1_authorizer_keystore() override {
+      return osd->ms_get_auth1_authorizer_keystore();
+    }
   } heartbeat_dispatcher;
 
 private: