Commit 42507f05 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  This was entirely broken.  We cannot skip the location walk just because
  we are in a file subrequest (think of a file server-status sitting in
  the document root, this shouldn't be blindly served as a 'file'.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89934 13f79535-47bb-0310-9956-ffa450edef68
parent ade1f9a2
Loading
Loading
Loading
Loading
+20 −24
Original line number Diff line number Diff line
@@ -1442,21 +1442,19 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
     * directory_walk
     */
    if (rnew->finfo.filetype == APR_DIR) {
        res = directory_walk(rnew);
        if (!res) {
            res = file_walk(rnew);
        }
        if (!(res = directory_walk(rnew)))
            if (!(res = file_walk(rnew)))
                res = location_walk(rnew);
    }
    else if (rnew->finfo.filetype == APR_REG || !rnew->finfo.filetype) {
        /*
         * do a file_walk, if it doesn't change the per_dir_config then
         * we know that we don't have to redo all the access checks
         */
        if ((res = file_walk(rnew))) {
            rnew->status = res;
            return rnew;
        }
        if (rnew->per_dir_config == r->per_dir_config) {
        if (   !(res = file_walk(rnew))
            && !(res = location_walk(rnew))
            && (rnew->per_dir_config == r->per_dir_config))
        {
            if (   (res = ap_run_type_checker(rnew)) 
                || (res = ap_run_fixups(rnew))) {
                rnew->status = res;
@@ -1549,21 +1547,19 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
         * directory_walk
         */
        if (rnew->finfo.filetype == APR_DIR) {
            res = directory_walk(rnew);
            if (!res) {
                res = file_walk(rnew);
            }
            if (!(res = directory_walk(rnew)))
                if (!(res = file_walk(rnew)))
                    res = location_walk(rnew);
        }
        else if (rnew->finfo.filetype == APR_REG || !rnew->finfo.filetype) {
            /*
             * do a file_walk, if it doesn't change the per_dir_config then
             * we know that we don't have to redo all the access checks
             */
        if ((res = file_walk(rnew))) {
            rnew->status = res;
            return rnew;
        }
        if (rnew->per_dir_config == r->per_dir_config) {
            if (   !(res = file_walk(rnew))
                && !(res = location_walk(rnew))
                && (rnew->per_dir_config == r->per_dir_config))
            {
                if (   (res = ap_run_type_checker(rnew)) 
                    || (res = ap_run_fixups(rnew))) {
                    rnew->status = res;