diff --git a/src/auth/Auth.h b/src/auth/Auth.h index 642164985e4..845f56c9bd6 100644 --- a/src/auth/Auth.h +++ b/src/auth/Auth.h @@ -192,6 +192,9 @@ struct AuthConnectionMeta { std::unique_ptr authorizer; std::unique_ptr authorizer_challenge; + + ///< set if msgr1 peer doesn't support CEPHX_V2 + bool skip_authorizer_challenge = false; }; /* diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index edff5f50958..2c8108bd104 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -1583,13 +1583,8 @@ int MonClient::handle_auth_request( } auto ac = &auth_meta->authorizer_challenge; - if (!HAVE_FEATURE(con->get_features(), CEPHX_V2)) { - if (cct->_conf->cephx_service_require_version >= 2) { - ldout(cct,10) << __func__ << " client missing CEPHX_V2 (" - << "cephx_service_requre_version = " - << cct->_conf->cephx_service_require_version << ")" << dendl; - return -EACCES; - } + if (auth_meta->skip_authorizer_challenge) { + ldout(cct, 10) << __func__ << " skipping challenge on " << con << dendl; ac = nullptr; } diff --git a/src/msg/async/ProtocolV1.cc b/src/msg/async/ProtocolV1.cc index 551920d408e..43363371bc3 100644 --- a/src/msg/async/ProtocolV1.cc +++ b/src/msg/async/ProtocolV1.cc @@ -2046,6 +2046,10 @@ CtPtr ProtocolV1::handle_connect_message_2() { ceph::buffer::list auth_bl_copy = authorizer_buf; auto am = auth_meta; am->auth_method = connect_msg.authorizer_protocol; + if (!HAVE_FEATURE((uint64_t)connect_msg.features, CEPHX_V2)) { + // peer doesn't support it and we won't get here if we require it + am->skip_authorizer_challenge = true; + } connection->lock.unlock(); ldout(cct,10) << __func__ << " authorizor_protocol " << connect_msg.authorizer_protocol