summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_common.cc
diff options
context:
space:
mode:
authorRadoslaw Zarzynski <rzarzyns@redhat.com>2017-06-27 17:37:41 +0200
committerRadoslaw Zarzynski <rzarzyns@redhat.com>2017-06-27 17:43:13 +0200
commited35722e9be7272977177e8c3b9d5b64aad13f46 (patch)
tree2b82c2786c2d8855659af1038b75b6089569443c /src/rgw/rgw_common.cc
parentMerge pull request #15874 from elliswuuuuuuuu/remove_unuse_config (diff)
downloadceph-ed35722e9be7272977177e8c3b9d5b64aad13f46.tar.xz
ceph-ed35722e9be7272977177e8c3b9d5b64aad13f46.zip
rgw: reject request if decoded URI contains \0 in the middle.
Fixes: http://tracker.ceph.com/issues/20418 Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Diffstat (limited to 'src/rgw/rgw_common.cc')
-rw-r--r--src/rgw/rgw_common.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc
index d4e494073ca..2f5a82561e6 100644
--- a/src/rgw/rgw_common.cc
+++ b/src/rgw/rgw_common.cc
@@ -108,6 +108,7 @@ rgw_http_errors rgw_http_s3_errors({
{ ERR_INTERNAL_ERROR, {500, "InternalError" }},
{ ERR_NOT_IMPLEMENTED, {501, "NotImplemented" }},
{ ERR_SERVICE_UNAVAILABLE, {503, "ServiceUnavailable"}},
+ { ERR_ZERO_IN_URL, {400, "InvalidRequest" }},
});
rgw_http_errors rgw_http_swift_errors({
@@ -118,6 +119,10 @@ rgw_http_errors rgw_http_swift_errors({
{ ERR_BAD_URL, {412, "Bad URL" }},
{ ERR_NOT_SLO_MANIFEST, {400, "Not an SLO manifest" }},
{ ERR_QUOTA_EXCEEDED, {413, "QuotaExceeded" }},
+ /* FIXME(rzarzynski): we need to find a way to apply Swift's error handling
+ * procedures also for ERR_ZERO_IN_URL. This make a problem as the validation
+ * is performed very early, even before setting the req_state::proto_flags. */
+ { ERR_ZERO_IN_URL, {412, "Invalid UTF8 or contains NULL"}},
});
int rgw_perf_start(CephContext *cct)