From: Radoslaw Zarzynski Date: Wed, 21 Sep 2016 13:42:09 +0000 (+0200) Subject: rgw: enforce presence of at least one file to upload in RGWFormPost. X-Git-Tag: v12.0.3~99^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2eea96a0217208bd3f76196c445f0ee34be37049;p=ceph.git rgw: enforce presence of at least one file to upload in RGWFormPost. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index cd6c69decdbc..49655cbea318 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -1847,6 +1847,11 @@ int RGWFormPost::get_params() } } while (! stream_done); + if (! current_data_part) { + err_msg = "FormPost: no files to process"; + return -EINVAL; + } + if (! is_non_expired()) { err_msg = "FormPost: Form Expired"; return -EACCES; @@ -1857,7 +1862,7 @@ int RGWFormPost::get_params() return -EACCES; } - return ! current_data_part ? -EINVAL : 0; + return 0; } std::string RGWFormPost::get_current_filename() const