EntityName entity_name;
if (!s->auth_handler) {
- uint64_t global_id = assign_global_id(m);
- if (!global_id)
+ s->global_id = assign_global_id(m);
+ if (!s->global_id)
goto done;
set<__u32> supported;
if (!s->auth_handler)
ret = -EPERM;
else {
+ ::encode(s->global_id, response_bl);
proto = s->auth_handler->start_session(entity_name, indata, response_bl);
if (proto == CEPH_AUTH_NONE) {
s->caps.set_allow_all(true);
void MonClient::handle_auth(MAuthReply *m)
{
+ bufferlist::iterator p = m->result_bl.begin();
if (state == MC_STATE_NEGOTIATING) {
if (!auth || (int)m->protocol != auth->get_protocol()) {
delete auth;
} else {
auth->reset();
}
+ try {
+ ::decode(global_id, p);
+ dout(0) << "decoded global_id=" << global_id << dendl;
+ } catch (buffer::error *err) {
+ delete m;
+ return;
+ }
state = MC_STATE_AUTHENTICATING;
}
assert(auth);
- bufferlist::iterator p = m->result_bl.begin();
int ret = auth->handle_response(m->result, p);
delete m;
uint32_t want_keys;
+ uint64_t global_id;
+
// mount
private:
client_t clientid;
timer(monc_lock),
hunting(false),
want_monmap(false),
- want_keys(0),
+ want_keys(0), global_id(0),
mounting(0), mount_err(0),
auth(NULL) { }
~MonClient() {
xlist<Session*>::item item;
set<__u64> routed_request_tids;
MonCaps caps;
+ uint64_t global_id;
map<nstring, Subscription*> sub_map;
AuthServiceHandler *auth_handler;
Session(entity_inst_t i) : inst(i), closed(false), item(this),
- auth_handler(NULL) {}
+ global_id(0), auth_handler(NULL) {}
~Session() {
generic_dout(0) << "~Session " << this << dendl;
// we should have been removed before we get destructed; see SessionMap::remove_session()