From 035389a4c54df6e31fcc18480ae62d731d173d1f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 4 Feb 2010 14:24:23 -0800 Subject: [PATCH] auth: tolerate bad authenticator replies (retry instead of crashing) --- src/auth/cephx/CephxProtocol.cc | 9 +++++++-- src/mds/MDS.cc | 2 +- src/osd/OSD.cc | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index eb5e644ab48eb..c9cff04e782e7 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -415,8 +415,13 @@ bool CephXAuthorizer::verify_reply(bufferlist::iterator& indata) { CephXAuthorizeReply reply; - if (decode_decrypt(reply, session_key, indata) < 0) { - dout(0) << "verify_authorizer_reply coudln't decrypt with " << session_key << dendl; + try { + if (decode_decrypt(reply, session_key, indata) < 0) { + dout(0) << "verify_authorizer_reply coudln't decrypt with " << session_key << dendl; + return false; + } + } catch (buffer::error *e) { + dout(0) << "verify_authorizer_reply exception in decode_decrypt with " << session_key << dendl; return false; } diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 878b58b652610..bc0080ad9f148 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1210,7 +1210,7 @@ bool MDS::ms_dispatch(Message *m) bool MDS::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) { - dout(0) << "MDS::ms_get_authorizer type=" << dest_type << dendl; + dout(10) << "MDS::ms_get_authorizer type=" << ceph_entity_type_name(dest_type) << dendl; /* monitor authorization is being handled on different layer */ if (dest_type == CEPH_ENTITY_TYPE_MON) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2da4ec9f00b61..6fd22cf97654e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1568,7 +1568,7 @@ bool OSD::ms_dispatch(Message *m) bool OSD::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) { - dout(0) << "OSD::ms_get_authorizer type=" << dest_type << dendl; + dout(10) << "OSD::ms_get_authorizer type=" << ceph_entity_type_name(dest_type) << dendl; if (dest_type == CEPH_ENTITY_TYPE_MON) return true; -- 2.39.5