From: Casey Bodley Date: Thu, 15 Jun 2017 18:55:12 +0000 (-0400) Subject: rgw: fix error mapping after auth strategy refactoring X-Git-Tag: v12.1.0~99^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15711%2Fhead;p=ceph.git rgw: fix error mapping after auth strategy refactoring the changes in bd81c216d0ef36a66c27180f13430c9702393fb6 inadvertently changed swift's default auth error from EPERM to ACCESS. hacky fix to change it back Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index a3ccdca781a6..2efa83b05086 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -2530,7 +2530,11 @@ RGWOp *RGWHandler_REST_Obj_SWIFT::op_options() int RGWHandler_REST_SWIFT::authorize() { - return rgw::auth::Strategy::apply(auth_strategy, s); + int r = rgw::auth::Strategy::apply(auth_strategy, s); + if (r == -EACCES) { // XXX: hacky fix for Strategy::apply() refactoring + r = -EPERM; + } + return r; } int RGWHandler_REST_SWIFT::postauth_init()