]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: the create_bucket forward request omits the
authorShilpa Jagannath <smanjara@redhat.com>
Tue, 24 Sep 2024 21:12:02 +0000 (17:12 -0400)
committerSeena Fallah <seenafallah@gmail.com>
Thu, 20 Mar 2025 20:24:30 +0000 (21:24 +0100)
the request body, thus missing some data if specified inside
CreateBucketConfiguration xml on the non-master zone.
also, now that we perform cksum validation against empty payloads,
such a request would fail with -ERR_AMZ_CONTENT_SHA256_MISMATCH due
to a zero content-length but a non-empty payload hash.
this fix ensures that request body is forwarded during create_bucket

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
(cherry picked from commit 43a6f123e24a772cc48a3a045d2136e13355c2a5)

src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index f492a5d2e4c730c6295f4747191294f8ee4728b8..1b2e71509837f330de6b30462c8b50ebefd15bf8 100644 (file)
@@ -3580,7 +3580,6 @@ void RGWCreateBucket::execute(optional_yield y)
 
   if (!driver->is_meta_master()) {
     // apply bucket creation on the master zone first
-    bufferlist in_data;
     JSONParser jp;
     op_ret = rgw_forward_request_to_master(this, *s->penv.site, s->owner.id,
                                            &in_data, &jp, s->info, y);
index 6a5a90bb61ee81aff520f8ac77f8d2abe3ee94d0..89e26311495ccd7a0e7297e8e17873068c721d1f 100644 (file)
@@ -1116,6 +1116,7 @@ class RGWCreateBucket : public RGWOp {
   bool relaxed_region_enforcement = false;
   RGWCORSConfiguration cors_config;
   std::set<std::string> rmattr_names;
+  bufferlist in_data;
 
   virtual bool need_metadata_upload() const { return false; }
 
index 9960c73c141cd8ec194b20f759485848509d0852..bedfad64235c1074138652efce22caf3c660aa45 100644 (file)
@@ -2461,6 +2461,10 @@ int RGWCreateBucket_ObjStore_S3::get_params(optional_yield y)
   if ((op_ret < 0) && (op_ret != -ERR_LENGTH_REQUIRED))
     return op_ret;
 
+  if (!driver->is_meta_master()) {
+    in_data.append(data);
+  }
+
   if (data.length()) {
     RGWCreateBucketParser parser;