Commit 8d90322a authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  The test of filename[0] == '/' is very evil ;)

  More patches required to;

    1. use apr_filepath_merge rather than apr_pstrcat for creating proper
       and canonical paths.

    2. untangle the proxy: fooness that no longer works in directory_walk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91622 13f79535-47bb-0310-9956-ffa450edef68
parent 19e4da36
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1222,8 +1222,8 @@ static int hook_uri2file(request_rec *r)
#endif
            rewritelog(r, 2, "local path result: %s", r->filename);

            /* the filename has to start with a slash! */
            if (r->filename[0] != '/') {
            /* the filename must be an absolute path! */
            if (!ap_os_is_path_absolute(r->pool, r->filename)) {
                return HTTP_BAD_REQUEST;
            }

@@ -1508,7 +1508,7 @@ static int hook_fixup(request_rec *r)
            }

            /* the filename has to start with a slash! */
            if (r->filename[0] != '/') {
            if (!ap_os_is_path_absolute(r->pool, r->filename)) {
                return HTTP_BAD_REQUEST;
            }

@@ -1990,7 +1990,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p,
     *   location, i.e. if it's not starting with either a slash
     *   or a fully qualified URL scheme.
     */
    if (prefixstrip && r->filename[0] != '/'
    if (prefixstrip && !ap_os_is_path_absolute(r->pool, r->filename)
	&& !is_absolute_uri(r->filename)) {
        rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s",
                   perdir, r->filename, perdir, r->filename);
@@ -2077,7 +2077,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p,
     *  not start with a slash. Here we add again the initially
     *  stripped per-directory prefix.
     */
    if (prefixstrip && r->filename[0] != '/') {
    if (prefixstrip && !ap_os_is_path_absolute(r->pool, r->filename)) {
        rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s",
                   perdir, r->filename, perdir, r->filename);
        r->filename = apr_pstrcat(r->pool, perdir, r->filename, NULL);