]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix MalformedXML errors in PutBucketObjectLock/PutObjRetention
authorCasey Bodley <cbodley@redhat.com>
Fri, 28 Jun 2019 18:54:54 +0000 (14:54 -0400)
committerPaul Emmerich <paul.emmerich@croit.io>
Thu, 3 Oct 2019 09:30:45 +0000 (11:30 +0200)
RGWPutBucketObjectLock was not calling get_params(), so the 'data' it
was trying to parse was empty

RGWPutObjRetention was calling get_params() a second time, which
overwrote the 'data' from the first call

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 33a00eee3cc00e7d6ac3b79d0c00766aa410c53f)

src/rgw/rgw_op.cc

index 5fa74883c37304821a21fa9d85c26228af4cea64..20d05333caef8ccd3fbbc22aa7ec0986c01a2d8b 100644 (file)
@@ -7532,7 +7532,10 @@ void RGWPutBucketObjectLock::execute()
     op_ret = -EINVAL;
     return;
   }
-
+  op_ret = get_params();
+  if (op_ret < 0) {
+    return;
+  }
   if (!parser.parse(data.c_str(), data.length(), 1)) {
     op_ret = -ERR_MALFORMED_XML;
     return;
@@ -7621,10 +7624,6 @@ void RGWPutObjRetention::execute()
     return;
   }
 
-  op_ret = get_params();
-  if (op_ret < 0)
-    return;
-
   if (!parser.parse(data.c_str(), data.length(), 1)) {
     op_ret = -ERR_MALFORMED_XML;
     return;