From: Volker Theile Date: Fri, 20 Jan 2023 16:02:01 +0000 (+0100) Subject: pacific: rgw: an empty tagset is allowed by S3 X-Git-Tag: v16.2.13~123^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=614910d5ed51a2a58d7ef48665791ed3ecd18198;p=ceph.git pacific: rgw: an empty tagset is allowed by S3 Fixes: https://tracker.ceph.com/issues/58470 Signed-off-by: Volker Theile Signed-off-by: Liu Lan (cherry picked from commit 3ae77c51a74f441d1e9a078fc7bf61103f783b5e) --- diff --git a/src/rgw/rgw_tag.cc b/src/rgw/rgw_tag.cc index e60a265e7384..b9ca88f04ac6 100644 --- a/src/rgw/rgw_tag.cc +++ b/src/rgw/rgw_tag.cc @@ -32,6 +32,9 @@ int RGWObjTags::check_and_add_tag(const string&key, const string& val){ } int RGWObjTags::set_from_string(const string& input){ + if (input.empty()) { + return 0; + } int ret=0; vector kvs; boost::split(kvs, input, boost::is_any_of("&")); diff --git a/src/rgw/rgw_tag_s3.cc b/src/rgw/rgw_tag_s3.cc index 2c352c592030..494e6b8744f0 100644 --- a/src/rgw/rgw_tag_s3.cc +++ b/src/rgw/rgw_tag_s3.cc @@ -30,7 +30,8 @@ void RGWObjTagEntry_S3::dump_xml(Formatter *f) const { void RGWObjTagSet_S3::decode_xml(XMLObj *obj) { vector entries; - RGWXMLDecoder::decode_xml("Tag", entries, obj, true); + bool mandatory{false}; + RGWXMLDecoder::decode_xml("Tag", entries, obj, mandatory); for (auto& entry : entries) { const std::string& key = entry.get_key();