Skip to content

Commit 146d4d9

Browse files
committed
rgw: return 404 on no bucket public access block
Return 404 when there is no public access block on the bucket. Fixes: https://tracker.ceph.com/issues/64492 Signed-off-by: Seena Fallah <[email protected]>
1 parent 54bc5eb commit 146d4d9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/rgw/rgw_common.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ rgw_http_errors rgw_http_s3_errors({
131131
{ ERR_ZERO_IN_URL, {400, "InvalidRequest" }},
132132
{ ERR_NO_SUCH_TAG_SET, {404, "NoSuchTagSet"}},
133133
{ ERR_NO_SUCH_BUCKET_ENCRYPTION_CONFIGURATION, {404, "ServerSideEncryptionConfigurationNotFoundError"}},
134+
{ ERR_NO_SUCH_PUBLIC_ACCESS_BLOCK_CONFIGURATION, {404, "NoSuchPublicAccessBlockConfiguration"}},
134135
});
135136

136137
rgw_http_errors rgw_http_swift_errors({

src/rgw/rgw_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ static inline const char* to_mime_type(const RGWFormat f)
282282
#define ERR_NO_SUCH_OBJECT_LOCK_CONFIGURATION 2046
283283
#define ERR_INVALID_RETENTION_PERIOD 2047
284284
#define ERR_NO_SUCH_BUCKET_ENCRYPTION_CONFIGURATION 2048
285+
#define ERR_NO_SUCH_PUBLIC_ACCESS_BLOCK_CONFIGURATION 2049
285286
#define ERR_USER_SUSPENDED 2100
286287
#define ERR_INTERNAL_ERROR 2200
287288
#define ERR_NOT_IMPLEMENTED 2201

src/rgw/rgw_op.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8997,7 +8997,10 @@ void RGWGetBucketPublicAccessBlock::execute(optional_yield y)
89978997
aiter == attrs.end()) {
89988998
ldpp_dout(this, 0) << "can't find bucket IAM POLICY attr bucket_name = "
89998999
<< s->bucket_name << dendl;
9000-
// return the default;
9000+
9001+
op_ret = -ERR_NO_SUCH_PUBLIC_ACCESS_BLOCK_CONFIGURATION;
9002+
s->err.message = "The public access block configuration was not found";
9003+
90019004
return;
90029005
} else {
90039006
bufferlist::const_iterator iter{&aiter->second};

0 commit comments

Comments
 (0)