From: Casey Bodley Date: Wed, 8 Jan 2025 21:55:19 +0000 (-0500) Subject: rgw: reject PutBucketLifecycleConfiguration on indexless buckets X-Git-Tag: v20.0.0~43^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F61269%2Fhead;p=ceph.git rgw: reject PutBucketLifecycleConfiguration on indexless buckets Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index e5eaf4805a940..d3615377ba88b 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -6264,6 +6264,13 @@ void RGWPutACLs::execute(optional_yield y) void RGWPutLC::execute(optional_yield y) { + if (const auto& current_index = s->bucket->get_info().layout.current_index; + current_index.layout.type == rgw::BucketIndexType::Indexless) { + s->err.message = "Indexless buckets do not support lifecycle policy"; + op_ret = -ERR_METHOD_NOT_ALLOWED; + return; + } + bufferlist bl; RGWLifecycleConfiguration_S3 config(s->cct);