]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: cephx: KeyServer: add 'has_secrets()' function
authorJoao Eduardo Luis <joao.luis@inktank.com>
Thu, 21 Jun 2012 00:23:03 +0000 (01:23 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 12 Feb 2013 13:22:33 +0000 (13:22 +0000)
We need this in the AuthMonitor to assess if we should encode a full version
of the KeyServer and submit it to the Paxos along with the incrementals.

Not performing such a check will lead us to an erroneous version, from which
we won't be able to recover.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/auth/cephx/CephxKeyServer.h

index 60b424b0bd56f02e929d851e1b386db5f5e27226..11575cff895d4dc6e7f2f757e72e6d7b12cca225 100644 (file)
@@ -259,6 +259,11 @@ public:
     data.remove_secret(name);
   }
 
+  bool has_secrets() {
+    map<EntityName, EntityAuth>::const_iterator b = data.secrets_begin();
+    return (b != data.secrets_end());
+  }
+
   /*void add_rotating_secret(uint32_t service_id, ExpiringCryptoKey& key) {
     Mutex::Locker l(lock);
     data.add_rotating_secret(service_id, key);