]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reject PutBucketLifecycleConfiguration on indexless buckets 61269/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 8 Jan 2025 21:55:19 +0000 (16:55 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 25 Feb 2025 16:15:57 +0000 (11:15 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_op.cc

index e5eaf4805a940057ae7569216fa7b9884e44caba..d3615377ba88b118d5c241774d3c386c81e18ccc 100644 (file)
@@ -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);