also, we should not crash on empty auth request buffer.
see also
64eddc4d and
b99daab1
Signed-off-by: Kefu Chai <kchai@redhat.com>
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) {