From 81d362b5935eaae118008f42955fedbdf3a40210 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Oct 2009 14:27:35 -0700 Subject: [PATCH] auth: fix up ms_get_authorizer Never return authorizer for monitors. --- src/librados.cc | 7 ++++--- src/mds/MDS.cc | 5 +---- src/osd/OSD.cc | 5 +---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/librados.cc b/src/librados.cc index cafe5af67cd0b..7d19b22bbf8a5 100644 --- a/src/librados.cc +++ b/src/librados.cc @@ -62,9 +62,10 @@ class RadosClient : public Dispatcher bool ms_get_authorizer(int dest_type, AuthAuthorizer& authorizer, bool force_new) { dout(0) << "RadosClient::ms_get_authorizer type=" << dest_type << dendl; - if (monclient.auth.build_authorizer(dest_type, authorizer) < 0) - return false; - return true; + /* monitor authorization is being handled on different layer */ + if (dest_type == CEPH_ENTITY_TYPE_MON) + return true; + return monclient.auth.build_authorizer(dest_type, authorizer); } void ms_handle_connect(Connection *con); bool ms_handle_reset(Connection *con); diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 80f3dcd1082b0..7ed508768a196 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1168,10 +1168,7 @@ bool MDS::ms_get_authorizer(int dest_type, AuthAuthorizer& authorizer, bool forc return false; } - if (monc->auth.build_authorizer(dest_type, authorizer) < 0) - return false; - - return true; + return monc->auth.build_authorizer(dest_type, authorizer); } bool MDS::_dispatch(Message *m) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 6aecc5454a57d..c851cdab95c76 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1511,10 +1511,7 @@ bool OSD::ms_get_authorizer(int dest_type, AuthAuthorizer& authorizer, bool forc return false; } - if (monc->auth.build_authorizer(dest_type, authorizer) < 0) - return false; - - return true; + return monc->auth.build_authorizer(dest_type, authorizer); } bool OSD::ms_verify_authorizer(Connection *con, int peer_type, -- 2.39.5