diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-08-26 19:46:43 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-09-04 16:26:14 -0700 |
commit | c8ec532fadc0df36e4b265fe20a2ff3e35319744 (patch) | |
tree | a832ee2fe905dfb87fe6e5e1e3757d74daae2af9 | |
parent | ea412c05f61e54c7a6749ca0b699e5fcbafa6191 (diff) | |
download | ceph-c8ec532fadc0df36e4b265fe20a2ff3e35319744.tar.gz |
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 <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_rest_s3.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index a9a391fc348..83874dd42c4 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -894,6 +894,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); |