From: Martin Kraemer Date: Wed, 29 May 2002 17:39:23 +0000 (+0000) Subject: Fix a problem in mod_rewrite which would lead to 400 Bad Request X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c28c1d78dd3073dff70a4f51b8213c41dccee2a5;p=thirdparty%2Fapache%2Fhttpd.git Fix a problem in mod_rewrite which would lead to 400 Bad Request responses for rewriting rules which resulted in a local path. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@95357 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/CHANGES b/src/CHANGES index 9eeef575112..07628536360 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 1.3.25 + *) Fix a problem in mod_rewrite which would lead to 400 Bad Request + responses for rewriting rules which resulted in a local path. + [Martin Kraemer] + *) Disallow anything but whitespace on the request line after the HTTP/x.y protocol string. That prevents arbitrary user input from ending up in the access_log and error_log. Also, special diff --git a/src/modules/standard/mod_rewrite.c b/src/modules/standard/mod_rewrite.c index 729b2fa39a5..cf8e48b3806 100644 --- a/src/modules/standard/mod_rewrite.c +++ b/src/modules/standard/mod_rewrite.c @@ -1220,7 +1220,7 @@ static int hook_uri2file(request_rec *r) rewritelog(r, 2, "local path result: %s", r->filename); /* the filename has to start with a slash! */ - if (ap_os_is_path_absolute(r->filename)) { + if (!ap_os_is_path_absolute(r->filename)) { return BAD_REQUEST; } @@ -1505,7 +1505,7 @@ static int hook_fixup(request_rec *r) } /* the filename has to start with a slash! */ - if (ap_os_is_path_absolute(r->filename)) { + if (!ap_os_is_path_absolute(r->filename)) { return BAD_REQUEST; }