]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return 404 on no bucket public access block
authorSeena Fallah <seenafallah@gmail.com>
Mon, 19 Feb 2024 17:23:07 +0000 (18:23 +0100)
committerSeena Fallah <seenafallah@gmail.com>
Tue, 20 Feb 2024 14:55:40 +0000 (15:55 +0100)
Return 404 when there is no public access block on the bucket.

Fixes: https://tracker.ceph.com/issues/64492
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_op.cc

index 3ee98fa18ca16b68235adf639fcd20de970621e6..45d3dd066184fe10389771a1c9604deb285b8d7d 100644 (file)
@@ -131,6 +131,7 @@ rgw_http_errors rgw_http_s3_errors({
     { ERR_ZERO_IN_URL, {400, "InvalidRequest" }},
     { ERR_NO_SUCH_TAG_SET, {404, "NoSuchTagSet"}},
     { ERR_NO_SUCH_BUCKET_ENCRYPTION_CONFIGURATION, {404, "ServerSideEncryptionConfigurationNotFoundError"}},
+    { ERR_NO_SUCH_PUBLIC_ACCESS_BLOCK_CONFIGURATION, {404, "NoSuchPublicAccessBlockConfiguration"}},
 });
 
 rgw_http_errors rgw_http_swift_errors({
index aecb5721e7a1b473cc3fd8e68e3c3a818d01905b..c2066a756f8ae40ccba4df667c0bfa62a8d8b1ad 100644 (file)
@@ -282,6 +282,7 @@ static inline const char* to_mime_type(const RGWFormat f)
 #define ERR_NO_SUCH_OBJECT_LOCK_CONFIGURATION  2046
 #define ERR_INVALID_RETENTION_PERIOD 2047
 #define ERR_NO_SUCH_BUCKET_ENCRYPTION_CONFIGURATION 2048
+#define ERR_NO_SUCH_PUBLIC_ACCESS_BLOCK_CONFIGURATION 2049
 #define ERR_USER_SUSPENDED       2100
 #define ERR_INTERNAL_ERROR       2200
 #define ERR_NOT_IMPLEMENTED      2201
index 445119dd4aee7b0d69c90cb5526b98a88ecb08df..ab19a15dbc5835f8a93e4934b2f8a67ffdc86ce8 100644 (file)
@@ -8997,7 +8997,10 @@ void RGWGetBucketPublicAccessBlock::execute(optional_yield y)
       aiter == attrs.end()) {
     ldpp_dout(this, 0) << "can't find bucket IAM POLICY attr bucket_name = "
                       << s->bucket_name << dendl;
-    // return the default;
+
+    op_ret = -ERR_NO_SUCH_PUBLIC_ACCESS_BLOCK_CONFIGURATION;
+    s->err.message = "The public access block configuration was not found";
+
     return;
   } else {
     bufferlist::const_iterator iter{&aiter->second};