From: Abhishek Lekshmanan Date: Tue, 17 Oct 2017 14:19:30 +0000 (+0200) Subject: rgw: policy: add_to_iam_env now supports char* and checks for null X-Git-Tag: v13.0.2~246^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2e7054ef09e8d73db6798f0a47450e3e145baf1;p=ceph.git rgw: policy: add_to_iam_env now supports char* and checks for null Signed-off-by: Abhishek Lekshmanan --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 9b09dbd7721c..bc3b2a5fbe1b 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -573,7 +573,14 @@ 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){ - e[key] = val; + if (!val.empty()) + e[key] = val; +} + + +void rgw_add_to_iam_environment(rgw::IAM::Environment& e, const char* key, const char* val){ + if (key != nullptr && val != nullptr) + e[key] = val; } static int rgw_iam_add_tags_from_bl(struct req_state* s, bufferlist& bl){