inc.decode_entry(entry);
switch (inc.op) {
case AUTH_INC_ADD:
- if (entry.rotating) {
+ if (!entry.rotating) {
keys_server.add_secret(entry.name, entry.secret);
} else {
derr(0) << "got AUTH_INC_ADD with entry.rotating" << dendl;
if (m->cmd.size() > 1) {
if (m->cmd[1] == "add" ||
m->cmd[1] == "del" ||
- m->cmd[1] == "activate" ||
m->cmd[1] == "list") {
return false;
}
#include "auth/Auth.h"
#include "auth/AuthProtocol.h"
+#include "auth/KeysServer.h"
#include "config.h"
{
dout(10) << "_reopen_session" << dendl;
_pick_new_mon();
+
+ dout(0) << "_reopen_session 0" << dendl;
auth.start_session(this, 30.0);
+ dout(0) << "_reopen_session 1" << dendl;
+ _start_auth_rotating(KEY_ROTATE_TIME);
+ dout(0) << "_reopen_session 2" << dendl;
+
if (mounting)
_send_mount();
if (!sub_have.empty())
return auth.authorize(CEPHX_PRINCIPAL_MON, timeout);
}
-int MonClient::start_auth_rotating(EntityName& name, double timeout)
+int MonClient::_start_auth_rotating(double timeout)
{
+ if (entity_name.entity_type != CEPHX_PRINCIPAL_OSD)
+ return 0;
+
MAuthRotating *m = new MAuthRotating();
if (!m)
return -ENOMEM;
- Mutex::Locker l(monc_lock);
+ m->entity_name = entity_name;
_send_mon_message(m);
return -ENOMEM;
timer.add_event_after(timeout, auth_timeout_event);
- dout(0) << "MonClient::start_auth_rotating waiting" << dendl;
+ dout(0) << "MonClient::_start_auth_rotating waiting" << dendl;
auth_cond.Wait(monc_lock);
- dout(0) << "MonClient::start_auth_rotating wait ended" << dendl;
+ dout(0) << "MonClient::_start_auth_rotating wait ended" << dendl;
if (auth_got_timeout) {
- dout(0) << "MonClient::start_auth_rotating got timeout" << dendl;
+ dout(0) << "MonClient::_start_auth_rotating got timeout" << dendl;
return -ETIMEDOUT;
}
int cur_mon;
+ EntityName entity_name;
+
entity_addr_t my_addr;
Mutex monc_lock;
void handle_mount_ack(MClientMountAck* m);
public:
+ void set_entity_name(EntityName name) { entity_name = name; }
void _auth_rotating_timeout(double timeout) {
auth_got_timeout = true;
auth_cond.Signal();
}
- int start_auth_rotating(EntityName& name, double timeout);
+ int _start_auth_rotating(double timeout);
int mount(double mount_timeout);
int authenticate(double timeout);