From 77799a5b0cca02f012e41b925a34275a27fee415 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Thu, 21 Jun 2012 01:23:03 +0100 Subject: [PATCH] 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 --- src/auth/cephx/CephxKeyServer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/auth/cephx/CephxKeyServer.h b/src/auth/cephx/CephxKeyServer.h index 60b424b0bd56f..11575cff895d4 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); -- 2.39.5