From: Yehuda Sadeh Date: Fri, 7 Dec 2012 02:12:51 +0000 (-0800) Subject: auth: improve logging X-Git-Tag: v0.55.1~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=907da185a89c773912b4370a04e224889104e6fe;p=ceph.git auth: improve logging Add some logging around failure cases. Signed-off-by: Yehuda Sadeh --- diff --git a/src/auth/AuthMethodList.cc b/src/auth/AuthMethodList.cc index e23ac40fa90e..f310cc0d0d1e 100644 --- a/src/auth/AuthMethodList.cc +++ b/src/auth/AuthMethodList.cc @@ -26,7 +26,11 @@ AuthMethodList::AuthMethodList(CephContext *cct, string str) { list sup_list; get_str_list(str, sup_list); + if (sup_list.empty()) { + lderr(cct) << "WARNING: empty auth protocol list" << dendl; + } for (list::iterator iter = sup_list.begin(); iter != sup_list.end(); ++iter) { + ldout(cct, 5) << "adding auth protocol: " << *iter << dendl; if (iter->compare("cephx") == 0) { auth_supported.push_back(CEPH_AUTH_CEPHX); } else if (iter->compare("none") == 0) { diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index 1bfc2814f4f2..821995a29101 100644 --- a/src/auth/Crypto.cc +++ b/src/auth/Crypto.cc @@ -320,8 +320,10 @@ int CryptoKey::set_secret(CephContext *cct, int type, bufferptr& s) created = ceph_clock_now(cct); CryptoHandler *h = cct->get_crypto_handler(type); - if (!h) + if (!h) { + lderr(cct) << "ERROR: cct->get_crypto_handler(type=" << type << ") returned NULL" << dendl; return -EOPNOTSUPP; + } int ret = h->validate_secret(s); if (ret < 0) @@ -338,8 +340,10 @@ int CryptoKey::create(CephContext *cct, int t) created = ceph_clock_now(cct); CryptoHandler *h = cct->get_crypto_handler(type); - if (!h) + if (!h) { + lderr(cct) << "ERROR: cct->get_crypto_handler(type=" << type << ") returned NULL" << dendl; return -EOPNOTSUPP; + } return h->create(secret); } diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index aec2ba04d864..84585912be54 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -346,6 +346,7 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable) type = mon->auth_service_required.pick(supported); s->auth_handler = get_auth_service_handler(type, g_ceph_context, &mon->key_server); if (!s->auth_handler) { + dout(1) << "client did not provide supported auth type" << dendl; ret = -ENOTSUP; goto reply; }