]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: check for non-existent bucket in RGWGetACLs 26212/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 30 Jan 2019 19:09:47 +0000 (14:09 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 30 Jan 2019 21:56:39 +0000 (16:56 -0500)
Fix incorrect result when attempting to fetch an ACL for a
bucket that does not exist.

This change leads to a NoSuchBucket error result when an ACL is
requested from a non-existent bucket.  A NoSuchKey error result
iss already seen when the target was an object.

Fixes: https://tracker.ceph.com/issues/38116
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_op.cc

index 3b12fffa8b6b2d659ab9114a48cfe2b445efd724..1d0f9a83caa457559f461b98dc1ae31bc6344906 100644 (file)
@@ -4903,6 +4903,9 @@ int RGWGetACLs::verify_permission()
     }
     perm = verify_object_permission(this, s, iam_action);
   } else {
+    if (!s->bucket_exists) {
+      return -ERR_NO_SUCH_BUCKET;
+    }
     perm = verify_bucket_permission(this, s, rgw::IAM::s3GetBucketAcl);
   }
   if (!perm)