From 76bd3d4b5e74c9fdea80320f4ab8cd973c85b353 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 8 Jan 2025 16:55:19 -0500 Subject: [PATCH] rgw: reject PutBucketLifecycleConfiguration on indexless buckets Signed-off-by: Casey Bodley --- src/rgw/rgw_op.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.39.5