From: Abhishek Lekshmanan Date: Fri, 9 Aug 2019 14:53:51 +0000 (+0200) Subject: rgw: url decode PutUserPolicy params X-Git-Tag: v15.1.0~1875^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fac4ab71fbee7f187db57e268c2e750eaf2802bc;p=ceph.git rgw: url decode PutUserPolicy params Since these are sent as a part of a POST request which is usually urlencoded, the json parser would later return invalid json for jsons containing whitespace Fixes: https://tracker.ceph.com/issues/41189 Signed-off-by: Abhishek Lekshmanan --- diff --git a/src/rgw/rgw_rest_user_policy.cc b/src/rgw/rgw_rest_user_policy.cc index 7afd11775b78..d93f69aee2ea 100644 --- a/src/rgw/rgw_rest_user_policy.cc +++ b/src/rgw/rgw_rest_user_policy.cc @@ -90,9 +90,9 @@ uint64_t RGWPutUserPolicy::get_op() int RGWPutUserPolicy::get_params() { - policy_name = s->info.args.get("PolicyName"); - user_name = s->info.args.get("UserName"); - policy = s->info.args.get("PolicyDocument"); + policy_name = url_decode(s->info.args.get("PolicyName"), true); + user_name = url_decode(s->info.args.get("UserName"), true); + policy = url_decode(s->info.args.get("PolicyDocument"), true); if (policy_name.empty() || user_name.empty() || policy.empty()) { ldout(s->cct, 20) << "ERROR: one of policy name, user name or policy document is empty"