From 808447cf68e3ba4102105651a25c3c0f9a063c81 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 26 Aug 2013 19:46:43 -0700 Subject: 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. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rest_s3.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 8690dd8fdbe..ab6e6644297 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); -- cgit v1.2.1