]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerCasey Bodley <cbodley@redhat.com>
Fri, 28 Jun 2019 18:54:58 +0000 (14:54 -0400)
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>
src/rgw/rgw_op.cc

index 7406d45c7d57f62464b48b32251bacb4f0f7a05b..dfea5ba31dbabd15c83bde584331de331fa84011 100644 (file)
@@ -7568,7 +7568,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;
@@ -7657,10 +7660,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;