lderr(cct) << "WARNING: unknown auth protocol defined: " << *iter << dendl;
}
}
+ if (auth_supported.empty()) {
+ auth_supported.push_back(CEPH_AUTH_CEPHX);
+ }
}
bool AuthMethodList::is_supported_auth(int auth_type)
mds_lock("MDS::mds_lock"),
timer(m->cct, mds_lock),
authorize_handler_cluster_registry(new AuthAuthorizeHandlerRegistry(m->cct,
- m->cct->_conf->auth_cluster_required.length() ?
- m->cct->_conf->auth_cluster_required :
- m->cct->_conf->auth_supported)),
+ m->cct->_conf->auth_supported.length() ?
+ m->cct->_conf->auth_supported :
+ m->cct->_conf->auth_cluster_required)),
authorize_handler_service_registry(new AuthAuthorizeHandlerRegistry(m->cct,
- m->cct->_conf->auth_service_required.length() ?
- m->cct->_conf->auth_service_required :
- m->cct->_conf->auth_supported)),
+ m->cct->_conf->auth_supported.length() ?
+ m->cct->_conf->auth_supported :
+ m->cct->_conf->auth_service_required)),
name(n),
whoami(-1), incarnation(0),
standby_for_rank(MDSMap::MDS_NO_STANDBY_PREF),
if (r == -ENOENT) {
// do we care?
string method;
- if (entity_name.get_type() == CEPH_ENTITY_TYPE_MDS ||
- entity_name.get_type() == CEPH_ENTITY_TYPE_OSD)
+ if (cct->_conf->auth_supported.length() != 0)
+ method = cct->_conf->auth_supported;
+ else if (entity_name.get_type() == CEPH_ENTITY_TYPE_MDS ||
+ entity_name.get_type() == CEPH_ENTITY_TYPE_OSD)
method = cct->_conf->auth_cluster_required;
else
method = cct->_conf->auth_client_required;
- if (method.length() == 0)
- method = cct->_conf->auth_supported;
AuthMethodList supported(cct, method);
if (!supported.is_supported_auth(CEPH_AUTH_CEPHX)) {
ldout(cct, 2) << "cephx auth is not supported, ignoring absence of keyring" << dendl;
schedule_tick();
string method;
- if (entity_name.get_type() == CEPH_ENTITY_TYPE_OSD ||
- entity_name.get_type() == CEPH_ENTITY_TYPE_MDS ||
- entity_name.get_type() == CEPH_ENTITY_TYPE_MON)
- method = cct->_conf->auth_cluster_required;
- else
- method = cct->_conf->auth_client_required;
- auth_supported = new AuthMethodList(cct, method.length() ? method : cct->_conf->auth_supported);
- ldout(cct, 10) << "auth_supported " << auth_supported->get_supported_set() << dendl;
+ if (cct->_conf->auth_supported.length() != 0)
+ method = cct->_conf->auth_supported;
+ else if (entity_name.get_type() == CEPH_ENTITY_TYPE_OSD ||
+ entity_name.get_type() == CEPH_ENTITY_TYPE_MDS ||
+ entity_name.get_type() == CEPH_ENTITY_TYPE_MON)
+ method = cct->_conf->auth_cluster_required;
+ else
+ method = cct->_conf->auth_client_required;
+ auth_supported = new AuthMethodList(cct, method);
+ ldout(cct, 10) << "auth_supported " << auth_supported->get_supported_set() << " method " << method << dendl;
initialized = true;
return 0;
clog(cct_, messenger, monmap, LogClient::FLAG_MON),
key_server(cct, &keyring),
auth_cluster_required(cct,
- cct->_conf->auth_cluster_required.length() ?
- cct->_conf->auth_cluster_required : cct->_conf->auth_supported),
+ cct->_conf->auth_supported.length() ?
+ cct->_conf->auth_supported : cct->_conf->auth_cluster_required),
auth_service_required(cct,
- cct->_conf->auth_service_required.length() ?
- cct->_conf->auth_service_required : cct->_conf->auth_supported),
+ cct->_conf->auth_supported.length() ?
+ cct->_conf->auth_supported : cct->_conf->auth_service_required),
store(s),
state(STATE_PROBING),
osd_lock("OSD::osd_lock"),
timer(external_messenger->cct, osd_lock),
authorize_handler_cluster_registry(new AuthAuthorizeHandlerRegistry(external_messenger->cct,
- cct->_conf->auth_cluster_required.length() ?
- cct->_conf->auth_cluster_required :
- cct->_conf->auth_supported)),
+ cct->_conf->auth_supported.length() ?
+ cct->_conf->auth_supported :
+ cct->_conf->auth_cluster_required)),
authorize_handler_service_registry(new AuthAuthorizeHandlerRegistry(external_messenger->cct,
- cct->_conf->auth_service_required.length() ?
- cct->_conf->auth_service_required :
- cct->_conf->auth_supported)),
+ cct->_conf->auth_supported.length() ?
+ cct->_conf->auth_supported :
+ cct->_conf->auth_service_required)),
cluster_messenger(internal_messenger),
client_messenger(external_messenger),
monc(mc),