]> granicus.if.org Git - apache/commitdiff
This was entirely broken. We cannot skip the location walk just because
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 6 Aug 2001 05:26:37 +0000 (05:26 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 6 Aug 2001 05:26:37 +0000 (05:26 +0000)
  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

server/request.c

index 5a0804945c98b55b7bd83a8b78724678ef8d69c3..31b7969d8e3367dc98c422ecdd8a351af23d3a78 100644 (file)
@@ -1442,23 +1442,21 @@ 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 = ap_run_type_checker(rnew)) 
-                    || (res = ap_run_fixups(rnew))) {
+        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;
             }
             return rnew;
@@ -1549,27 +1547,25 @@ 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 = ap_run_type_checker(rnew)) 
+            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;
+                    rnew->status = res;
+                }
+                return rnew;
             }
-            return rnew;
-        }  
         }
         else {
             ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, rnew,