summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-08-26 19:46:43 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-08-26 19:46:43 -0700
commit808447cf68e3ba4102105651a25c3c0f9a063c81 (patch)
tree1b96297b6a1b09d1e23f02a9bf60e4f74a2ed721
parent4b529c8bceea98aaf69dceec3a4d1a239036d5d7 (diff)
downloadceph-wip-6088.tar.gz
rgw: check object name after rebuilding it in S3 POSTwip-6088
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 <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_rest_s3.cc5
1 files changed, 5 insertions, 0 deletions
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);