]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/async: msgr2: close connection when no authorizer is given
authorRicardo Dias <rdias@suse.com>
Wed, 9 Jan 2019 11:05:03 +0000 (11:05 +0000)
committerRicardo Dias <rdias@suse.com>
Wed, 23 Jan 2019 13:59:26 +0000 (13:59 +0000)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/msg/async/ProtocolV2.cc

index daac5c5c3593064dfe13904e7ce0d700622e0605..5dadab9a7edccc2e3f6ffc6efbee349fd48fb0b9 100644 (file)
@@ -2070,9 +2070,8 @@ CtPtr ProtocolV2::send_auth_request(std::vector<uint32_t> &allowed_methods) {
     return nullptr;
   }
 
-  ldout(cct, 10) << __func__
-                 << " sending auth request len=" << authorizer->bl.length()
-                 << dendl;
+  ldout(cct, 10) << __func__ << " sending auth request method=" << auth_method
+                 << " len=" << authorizer->bl.length() << dendl;
 
   AuthRequestFrame authFrame(auth_method, authorizer->bl.length(),
                              authorizer->bl);
@@ -2116,9 +2115,16 @@ CtPtr ProtocolV2::handle_auth_bad_auth(char *payload, uint32_t length) {
   delete authorizer;
   authorizer = messenger->ms_deliver_get_authorizer(connection->peer_type,
                                                     true);  // try harder
-  ldout(cct, 10) << __func__
-                 << " sending auth request len=" << authorizer->bl.length()
-                 << dendl;
+
+  if (!authorizer) {
+    ldout(cct, 1) << __func__
+                  << " could not get an authorizer, closing connection"
+                  << dendl;
+    return _fault();
+  }
+
+  ldout(cct, 10) << __func__ << " sending auth request method=" << auth_method
+                 << " len=" << authorizer->bl.length() << dendl;
 
   AuthRequestFrame authFrame(auth_method, authorizer->bl.length(),
                              authorizer->bl);