]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/mon: tolerate lack of authorizer for some messengers
authorKefu Chai <kchai@redhat.com>
Thu, 25 Apr 2019 05:36:59 +0000 (13:36 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 28 Apr 2019 16:12:57 +0000 (00:12 +0800)
also, we should not crash on empty auth request buffer.

see also 64eddc4d and b99daab1

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/mon/MonClient.cc

index 4a527b574525b38f4acfedc45cd194939625a501..235b4a56c86f8cecc053bcb258700d31cf86f371 100644 (file)
@@ -525,6 +525,16 @@ int Client::handle_auth_request(ceph::net::ConnectionRef con,
                                 const ceph::bufferlist& payload,
                                 ceph::bufferlist *reply)
 {
+  // for some channels prior to nautilus (osd heartbeat), we tolerate the lack of
+  // an authorizer.
+  if (payload.length() == 0) {
+    if (con->get_messenger()->get_require_authorizer()) {
+      return -EACCES;
+    } else {
+      auth_handler.handle_authentication({}, {}, {});
+      return 1;
+    }
+  }
   auth_meta->auth_mode = payload[0];
   if (auth_meta->auth_mode < AUTH_MODE_AUTHORIZER ||
       auth_meta->auth_mode > AUTH_MODE_AUTHORIZER_MAX) {