From: Kefu Chai Date: Thu, 25 Apr 2019 05:36:59 +0000 (+0800) Subject: crimson/mon: tolerate lack of authorizer for some messengers X-Git-Tag: v15.1.0~2803^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a1095968aab1e75fe7d18ccd32eff3395ec9fff;p=ceph.git 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 --- diff --git a/src/crimson/mon/MonClient.cc b/src/crimson/mon/MonClient.cc index 4a527b574525..235b4a56c86f 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) {