From: Joao Eduardo Luis Date: Thu, 21 Jun 2012 00:23:03 +0000 (+0100) Subject: auth: cephx: KeyServer: add 'has_secrets()' function X-Git-Tag: v0.59~150^2~1^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=77799a5b0cca02f012e41b925a34275a27fee415;p=ceph.git auth: cephx: KeyServer: add 'has_secrets()' function 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 --- diff --git a/src/auth/cephx/CephxKeyServer.h b/src/auth/cephx/CephxKeyServer.h index 60b424b0bd56..11575cff895d 100644 --- a/src/auth/cephx/CephxKeyServer.h +++ b/src/auth/cephx/CephxKeyServer.h @@ -259,6 +259,11 @@ public: data.remove_secret(name); } + bool has_secrets() { + map::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);