From 33a00eee3cc00e7d6ac3b79d0c00766aa410c53f Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 28 Jun 2019 14:54:54 -0400 Subject: [PATCH] rgw: fix MalformedXML errors in PutBucketObjectLock/PutObjRetention 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 --- src/rgw/rgw_op.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 7406d45c7d57..dfea5ba31dba 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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; -- 2.47.3