]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/mon: fix the v1 auth
authorKefu Chai <kchai@redhat.com>
Thu, 9 May 2019 09:51:33 +0000 (17:51 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 9 May 2019 09:51:38 +0000 (17:51 +0800)
commit86b5989175a88812e4f5f89560cf075a9ea249bf
treea111a3a07529f752190636df61b8bc583ae335ea
parent6fe8d8223e32e236c861651dc6a70fa975e6db75
crimson/mon: fix the v1 auth

* initialize mon::Connection::global_id to `0` in the ctor.
  global_id is assigned by monitor, a zero global_id implies
  that "allocate me a new global_id please". so we should
  never use a random number on stack for the global_id.
* do not use a magic number for initializing MAuth::protocol,
  use `CEPH_AUTH_UNKNOWN` instead.
* do not try to dereference `auth` before creating it. `auth`
  is created by `create_auth()`. in which, the global_id
  is always assigned to `auth->global_id`, as it's a new session.
  so we should just call `create_auth()`.
* restructure the code to finish the authentication. to remove
  the find_if(), and use the `parallel_for_each()` loop for
  both set the active_con and closing the other pending connections.
* ask for the rotating keyring once gets authenticated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/mon/MonClient.cc