]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: get keys, build authorizer
authorSage Weil <sage@newdream.net>
Tue, 10 Nov 2009 00:07:59 +0000 (16:07 -0800)
committerSage Weil <sage@newdream.net>
Tue, 10 Nov 2009 00:09:33 +0000 (16:09 -0800)
src/auth/cephx/CephxProtocol.cc
src/client/Client.cc

index 5e25825e073b45a203b6b7fb3a66f79524407960..7b7ee596db5836147840033e1c4525ec7db4d349 100644 (file)
@@ -221,6 +221,7 @@ CephXAuthorizer *CephXTicketHandler::build_authorizer(uint64_t global_id)
   CephXAuthorize msg;
   msg.nonce = a->nonce;
   if (encode_encrypt(msg, session_key, a->bl) < 0) {
+    dout(0) << "failed to encrypt authorizer" << dendl;
     delete a;
     return 0;
   }
@@ -235,8 +236,10 @@ CephXAuthorizer *CephXTicketHandler::build_authorizer(uint64_t global_id)
 CephXAuthorizer *CephXTicketManager::build_authorizer(uint32_t service_id)
 {
   map<uint32_t, CephXTicketHandler>::iterator iter = tickets_map.find(service_id);
-  if (iter == tickets_map.end())
-    return false;
+  if (iter == tickets_map.end()) {
+    dout(0) << "no TicketHandler for service " << service_id << dendl;
+    return NULL;
+  }
 
   CephXTicketHandler& handler = iter->second;
   return handler.build_authorizer(global_id);
index 273855de2d46fd2391477a6157944c172647945f..d1382fd231f8c3f3219d0776c40765a22e4a635a 100644 (file)
@@ -260,6 +260,7 @@ void Client::init()
   messenger->add_dispatcher_head(this);
 
   monclient->init();
+  monclient->set_want_keys(CEPH_ENTITY_TYPE_MDS | CEPH_ENTITY_TYPE_OSD);
 
   // do logger crap only once per process.
   static bool did_init = false;
@@ -5963,5 +5964,6 @@ bool Client::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool
 {
   if (dest_type == CEPH_ENTITY_TYPE_MON)
     return true;
-  return monclient->auth->build_authorizer(dest_type);
+  *authorizer = monclient->auth->build_authorizer(dest_type);
+  return true;
 }