From 0e13995458060c0fc0ac30457b10b8ca94a3d5e6 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Wed, 30 Jan 2019 14:09:47 -0500 Subject: [PATCH] rgw: check for non-existent bucket in RGWGetACLs 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 (cherry picked from commit 078981ca4ef1610ab89b60f4c281f521d6838a37) Conflicts: src/rgw/rgw_op.cc : Resolved in verify_permission --- src/rgw/rgw_op.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 730de87fa31ef..e0cda1af41105 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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) -- 2.39.5