From 23dca207476ad4bf30f52a982b862c7aa056a81a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 30 Jun 2019 18:01:13 +0800 Subject: [PATCH] crimson: store ticket.peer_global_id in connection peer_global_id is used by `ProtocolV2::_handle_auth_request()` when encoding an `AuthDoneFrame`. Signed-off-by: Kefu Chai --- src/crimson/common/auth_handler.h | 1 - src/crimson/mon/MonClient.cc | 7 +++---- src/crimson/osd/osd.cc | 3 +-- src/crimson/osd/osd.h | 1 - src/test/crimson/test_monc.cc | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/crimson/common/auth_handler.h b/src/crimson/common/auth_handler.h index 521c75d0a42..922df6486dd 100644 --- a/src/crimson/common/auth_handler.h +++ b/src/crimson/common/auth_handler.h @@ -11,7 +11,6 @@ class AuthHandler { public: // the peer just got authorized virtual void handle_authentication(const EntityName& name, - uint64_t global_id, const AuthCapsInfo& caps) = 0; virtual ~AuthHandler() = default; }; diff --git a/src/crimson/mon/MonClient.cc b/src/crimson/mon/MonClient.cc index 6bc976f5190..9660e639e93 100644 --- a/src/crimson/mon/MonClient.cc +++ b/src/crimson/mon/MonClient.cc @@ -600,7 +600,7 @@ int Client::handle_auth_request(ceph::net::ConnectionRef con, if (con->get_messenger()->get_require_authorizer()) { return -EACCES; } else { - auth_handler.handle_authentication({}, {}, {}); + auth_handler.handle_authentication({}, {}); return 1; } } @@ -619,7 +619,6 @@ int Client::handle_auth_request(ceph::net::ConnectionRef con, ceph_assert(active_con); bool was_challenge = (bool)auth_meta->authorizer_challenge; EntityName name; - uint64_t global_id; AuthCapsInfo caps_info; bool is_valid = ah->verify_authorizer( &cct, @@ -628,13 +627,13 @@ int Client::handle_auth_request(ceph::net::ConnectionRef con, auth_meta->get_connection_secret_length(), reply, &name, - &global_id, + &active_con->get_conn()->peer_global_id, &caps_info, &auth_meta->session_key, &auth_meta->connection_secret, &auth_meta->authorizer_challenge); if (is_valid) { - auth_handler.handle_authentication(name, global_id, caps_info); + auth_handler.handle_authentication(name, caps_info); return 1; } if (!more && !was_challenge && auth_meta->authorizer_challenge) { diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index c76da4e3c49..5515ee35be7 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -481,8 +481,7 @@ seastar::future<> OSD::ms_handle_remote_reset(ceph::net::ConnectionRef conn) } void OSD::handle_authentication(const EntityName& name, - uint64_t global_id, - const AuthCapsInfo& caps) + const AuthCapsInfo& caps) { // todo } diff --git a/src/crimson/osd/osd.h b/src/crimson/osd/osd.h index 7b55b6e311b..1d12d70fbd2 100644 --- a/src/crimson/osd/osd.h +++ b/src/crimson/osd/osd.h @@ -105,7 +105,6 @@ class OSD final : public ceph::net::Dispatcher, // AuthHandler methods void handle_authentication(const EntityName& name, - uint64_t global_id, const AuthCapsInfo& caps) final; ceph::osd::ShardServices shard_services; diff --git a/src/test/crimson/test_monc.cc b/src/test/crimson/test_monc.cc index fd43fb86ddc..fc3984f8119 100644 --- a/src/test/crimson/test_monc.cc +++ b/src/test/crimson/test_monc.cc @@ -14,7 +14,6 @@ namespace { class DummyAuthHandler : public ceph::common::AuthHandler { public: void handle_authentication(const EntityName& name, - uint64_t global_id, const AuthCapsInfo& caps) final {} }; -- 2.47.3