Skip to content

Commit

Permalink
auth: remove AUTH_UNKNOWN weirdness, hardcoded defaults.
Browse files Browse the repository at this point in the history
This is what the old code does so I kept it but I don't think it makes any sense.
Same with the defaults; let's just set the config option to something valid.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Feb 7, 2019
1 parent ecf41b1 commit 028f1af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/auth/AuthRegistry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,11 @@ void AuthRegistry::_parse_method_list(const string& s,
} else if (i == "gss") {
v->push_back(CEPH_AUTH_GSS);
} else {
v->push_back(CEPH_AUTH_UNKNOWN);
lderr(cct) << "WARNING: unknown auth protocol defined: " << i << dendl;
}
}
if (v->empty()) {
lderr(cct) << "WARNING: no auth protocol defined, use 'cephx' by default"
<< dendl;
v->push_back(CEPH_AUTH_CEPHX);
lderr(cct) << "WARNING: no auth protocol defined" << dendl;
}
ldout(cct,20) << __func__ << " " << s << " -> " << *v << dendl;
}
Expand All @@ -82,14 +79,11 @@ void AuthRegistry::_parse_mode_list(const string& s,
} else if (i == "secure") {
v->push_back(CEPH_CON_MODE_SECURE);
} else {
v->push_back(CEPH_CON_MODE_UNKNOWN);
lderr(cct) << "WARNING: unknown connection mode " << i << dendl;
}
}
if (v->empty()) {
lderr(cct) << "WARNING: no connection modes defined, use 'crc' by default"
<< dendl;
v->push_back(CEPH_CON_MODE_CRC);
lderr(cct) << "WARNING: no connection modes defined" << dendl;
}
ldout(cct,20) << __func__ << " " << s << " -> " << *v << dendl;
}
Expand Down
6 changes: 6 additions & 0 deletions src/mon/MonClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1515,13 +1515,19 @@ int MonConnection::get_auth_request(
if (auth_method < 0) {
vector<uint32_t> as;
auth_registry->get_supported_methods(con->get_peer_type(), &as);
if (as.empty()) {
return -EACCES;
}
auth_method = as.front();
}
*method = auth_method;
auth_registry->get_supported_modes(con->get_peer_type(), auth_method,
preferred_modes);
ldout(cct,10) << __func__ << " method " << *method
<< " preferred_modes " << *preferred_modes << dendl;
if (preferred_modes->empty()) {
return -EACCES;
}

if (auth) {
auth.reset();
Expand Down

0 comments on commit 028f1af

Please sign in to comment.