]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return ERR_NO_SUCH_BUCKET early while evaluating bucket policy 31212/head 31213/head 31216/head 31217/head 31218/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 21 Feb 2019 16:06:52 +0000 (17:06 +0100)
committerNathan Cutler <ncutler@suse.com>
Tue, 29 Oct 2019 09:52:33 +0000 (10:52 +0100)
Right now we create a ERR_NO_SUCH_BUCKET ret code but continue further
processing. Since this ret code isn't returned at any stage we end up creating a
bucket instance anyway which shouldn't happen and then succeeding the client
call in cases like put bucket versioning. Return an error code early in these
cases

Fixes: http://tracker.ceph.com/issues/38420
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit cf66a6d5a7eee294313a1a08d0524daf939747e5)

src/rgw/rgw_op.cc

index cb795825978ee64e65d7077dada6fbcbc0323b3b..647c9e09ba21219ec38dd9dc0158b127066eb407 100644 (file)
@@ -482,8 +482,7 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
         s->bucket_acl->get_owner().get_display_name(),
       };
     } else {
-      s->bucket_acl->create_default(s->user->user_id, s->user->display_name);
-      ret = -ERR_NO_SUCH_BUCKET;
+      return -ERR_NO_SUCH_BUCKET;
     }
 
     s->bucket_owner = s->bucket_acl->get_owner();