}
// handler?
- AuthServiceHandler *auth_handler = get_auth_service_handler(
- auth_method, g_ceph_context, &key_server);
+ unique_ptr<AuthServiceHandler> auth_handler{get_auth_service_handler(
+ auth_method, g_ceph_context, &key_server)};
if (!auth_handler) {
dout(1) << __func__ << " auth_method " << auth_method << " not supported"
<< dendl;
if (mode < AUTH_MODE_MON ||
mode > AUTH_MODE_MON_MAX) {
dout(1) << __func__ << " invalid mode " << (int)mode << dendl;
- delete auth_handler;
return -EACCES;
}
assert(mode >= AUTH_MODE_MON && mode <= AUTH_MODE_MON_MAX);
decode(con->peer_global_id, p);
} catch (buffer::error& e) {
dout(1) << __func__ << " failed to decode, " << e.what() << dendl;
- delete auth_handler;
return -EACCES;
}
dout(10) << __func__ << " entity " << entity_name << " method "
<< auth_method << " not among supported "
<< auth_cluster_required.get_supported_set() << dendl;
- delete auth_handler;
return -EOPNOTSUPP;
}
} else {
dout(10) << __func__ << " entity " << entity_name << " method "
<< auth_method << " not among supported "
<< auth_cluster_required.get_supported_set() << dendl;
- delete auth_handler;
return -EOPNOTSUPP;
}
}
con->peer_global_id = authmon()->_assign_global_id();
if (!con->peer_global_id) {
dout(1) << __func__ << " failed to assign global_id" << dendl;
- delete auth_handler;
return -EBUSY;
}
dout(10) << __func__ << " assigned global_id " << con->peer_global_id
// set up partial session
s = new MonSession(con);
- s->auth_handler = auth_handler;
+ s->auth_handler = auth_handler.release();
con->set_priv(RefCountedPtr{s, false});
r = s->auth_handler->start_session(