From: Yehuda Sadeh Date: Tue, 27 Aug 2013 02:46:43 +0000 (-0700) Subject: rgw: check object name after rebuilding it in S3 POST X-Git-Tag: v0.67.3~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1a9651010aab51c9be2edeccd80e9bd11f5177ce;p=ceph.git rgw: check object name after rebuilding it in S3 POST Fixes: #6088 Backport: bobtail, cuttlefish, dumpling When posting an object it is possible to provide a key name that refers to the original filename, however we need to verify that in the end we don't end up with an empty object name. Reviewed-by: Josh Durgin Signed-off-by: Yehuda Sadeh (cherry picked from commit c8ec532fadc0df36e4b265fe20a2ff3e35319744) --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 8690dd8fdbebd..ab6e66442974c 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -893,6 +893,11 @@ int RGWPostObj_ObjStore_S3::get_params() rebuild_key(s->object_str); + if (s->object_str.empty()) { + err_msg = "Empty object name"; + return -EINVAL; + } + env.add_var("key", s->object_str); part_str("Content-Type", &content_type);