]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: improve logging
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 7 Dec 2012 02:12:51 +0000 (18:12 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Sat, 8 Dec 2012 06:32:59 +0000 (22:32 -0800)
Add some logging around failure cases.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/auth/AuthMethodList.cc
src/auth/Crypto.cc
src/mon/AuthMonitor.cc

index e23ac40fa90e2eb7df15504a47002b529545782a..f310cc0d0d1e07044627ea5242f2c49656464be4 100644 (file)
@@ -26,7 +26,11 @@ AuthMethodList::AuthMethodList(CephContext *cct, string str)
 {
   list<string> sup_list;
   get_str_list(str, sup_list);
+  if (sup_list.empty()) {
+    lderr(cct) << "WARNING: empty auth protocol list" << dendl;
+  }
   for (list<string>::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) {
index 1bfc2814f4f2427b50d02d5a6484a81fef67de8a..821995a29101502eefcaee8967875416a1850fed 100644 (file)
@@ -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);
 }
 
index aec2ba04d86462f1682fe0a47f0c67b5cbba3c74..84585912be54802a207d34cd475f2009ff690a5b 100644 (file)
@@ -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;
     }