From: Abhishek Lekshmanan Date: Fri, 20 Oct 2017 14:27:37 +0000 (+0200) Subject: rgw: policy: add_to_iam_env allows empty values X-Git-Tag: v13.0.2~246^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6ed31c0461206c43527c7e97e0340c4e489211b0;p=ceph.git rgw: policy: add_to_iam_env allows empty values Since null conditional just allows for presence of a header it makes sense to allow empty values as well for checking presence of a header Signed-off-by: Abhishek Lekshmanan --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index f054e461bf39..187f46d1ad17 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -573,7 +573,6 @@ void rgw_add_to_iam_environment(rgw::IAM::Environment& e, std::string&& key, std } void rgw_add_to_iam_environment(rgw::IAM::Environment& e, const std::string& key, const std::string& val){ - if (!val.empty()) e[key] = val; } @@ -584,15 +583,13 @@ void rgw_add_to_iam_environment(rgw::IAM::Environment& e, const char* key, const } static int rgw_iam_add_tags_from_bl(struct req_state* s, bufferlist& bl){ - int op_ret; RGWObjTags tagset; try { auto bliter = bl.begin(); tagset.decode(bliter); } catch (buffer::error& err) { ldout(s->cct,0) << "ERROR: caught buffer::error, couldn't decode TagSet" << dendl; - op_ret= -EIO; - return op_ret; + return -EIO; } for (const auto& tag: tagset.get_tags()){