Skip to content

Commit

Permalink
rgw: check for non-existent bucket in RGWGetACLs
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 078981c)

Conflicts:
	src/rgw/rgw_op.cc : Resolved in verify_permission
  • Loading branch information
mattbenjamin authored and Prashant D committed Feb 19, 2019
1 parent a2f258e commit 0e13995
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rgw/rgw_op.cc
Expand Up @@ -4625,6 +4625,9 @@ int RGWGetACLs::verify_permission()
rgw::IAM::s3GetObjectAcl :
rgw::IAM::s3GetObjectVersionAcl);
} else {
if (!s->bucket_exists) {
return -ERR_NO_SUCH_BUCKET;
}
perm = verify_bucket_permission(s, rgw::IAM::s3GetBucketAcl);
}
if (!perm)
Expand Down

0 comments on commit 0e13995

Please sign in to comment.