mon/MonClient: behave if authorizer can't be built (yet)

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-01-29 10:48:15 -06:00
parent 26a8bb65a7
commit a948c0d0de

View File

@ -1237,9 +1237,14 @@ int MonClient::get_auth_request(
auto auth_meta = con->get_auth_meta();
if (!auth) {
lderr(cct) << __func__ << " but no auth handler is set up" << dendl;
return -1;
return -EACCES;
}
auth_meta->authorizer.reset(auth->build_authorizer(con->get_peer_type()));
if (!auth_meta->authorizer) {
lderr(cct) << __func__ << " failed to build_authorizer for type "
<< ceph_entity_type_name(con->get_peer_type()) << dendl;
return -EACCES;
}
auth_meta->auth_method = auth_meta->authorizer->protocol;
auth_registry.get_supported_modes(con->get_peer_type(),
auth_meta->auth_method,