]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix error mapping after auth strategy refactoring 15711/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 15 Jun 2017 18:55:12 +0000 (14:55 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 16 Jun 2017 15:58:54 +0000 (11:58 -0400)
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 <cbodley@redhat.com>
src/rgw/rgw_rest_swift.cc

index a3ccdca781a634bb58c2fa1d7ed52ec1e9db3636..2efa83b050861bcbd86e548eaf4a634a8f51008b 100644 (file)
@@ -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()