return 0;
}
+static inline bool auth_principal_needs_rotating_keys(EntityName& name)
+{
+ return ((name.entity_type == CEPHX_PRINCIPAL_OSD) ||
+ (name.entity_type == CEPHX_PRINCIPAL_MDS));
+}
+
/*
* Verify authorizer and generate reply authorizer
*/
monc->get_monmap();
+ monc->wait_authenticate(30.0);
+ monc->wait_auth_rotating(30.0);
+
mds_lock.Lock();
// starting beacon. this will induce an MDSMap from the monitor
monc->sub_want("mdsmap", 0);
monc->renew_subs();
- monc->wait_authenticate(30.0);
- monc->wait_auth_rotating(30.0);
// schedule tick
reset_tick();
int MonClient::_start_auth_rotating()
{
- if (entity_name.entity_type != CEPHX_PRINCIPAL_OSD)
+ if (!auth_principal_needs_rotating_keys(entity_name))
return 0;
MAuthRotating *m = new MAuthRotating();
dout(0) << "MonClient::_start_auth_rotating sending message" << dendl;
_send_mon_message(m);
-#if 0
- auth_timeout_event = new C_AuthRotatingTimeout(this, timeout);
- if (!auth_timeout_event)
- return -ENOMEM;
- timer.add_event_after(timeout, auth_timeout_event);
-
- dout(0) << "MonClient::_start_auth_rotating waiting" << dendl;
- auth_cond.Wait(monc_lock);
- dout(0) << "MonClient::_start_auth_rotating wait ended" << dendl;
-
- if (auth_got_timeout) {
- dout(0) << "MonClient::_start_auth_rotating got timeout" << dendl;
- return -ETIMEDOUT;
- }
-
- if (auth_timeout_event) {
- timer.cancel_event(auth_timeout_event);
- auth_timeout_event = NULL;
- }
-#endif
return 0;
}
{
Mutex::Locker l(monc_lock);
- if (entity_name.entity_type != CEPHX_PRINCIPAL_OSD)
+ if (!auth_principal_needs_rotating_keys(entity_name))
return 0;
if (!g_keyring.need_rotating_secrets())