From 0a1095968aab1e75fe7d18ccd32eff3395ec9fff Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 25 Apr 2019 13:36:59 +0800 Subject: [PATCH] crimson/mon: tolerate lack of authorizer for some messengers also, we should not crash on empty auth request buffer. see also 64eddc4d and b99daab1 Signed-off-by: Kefu Chai --- src/crimson/mon/MonClient.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/crimson/mon/MonClient.cc b/src/crimson/mon/MonClient.cc index 4a527b57452..235b4a56c86 100644 --- a/src/crimson/mon/MonClient.cc +++ b/src/crimson/mon/MonClient.cc @@ -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) { -- 2.39.5