]> git.kaiwu.me - nginx.git/commitdiff
ignore NGX_EACCES error while directory test
authorIgor Sysoev <igor@sysoev.ru>
Sun, 17 Aug 2008 17:38:48 +0000 (17:38 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sun, 17 Aug 2008 17:38:48 +0000 (17:38 +0000)
src/http/modules/ngx_http_index_module.c

index a03b9f62e82fc6c149df39a87d671cfd26af1694..434ae60c5687c6768b2e43790f3e6b7400215cd6 100644 (file)
@@ -309,6 +309,19 @@ ngx_http_index_test_dir(ngx_http_request_t *r, ngx_http_core_loc_conf_t *clcf,
                 return ngx_http_index_error(r, clcf, dir.data, NGX_ENOENT);
             }
 
+            if (of.err == NGX_EACCES) {
+
+                *last = c;
+
+                /*
+                 * ngx_http_index_test_dir() is called after the first index
+                 * file testing has returned an error distinct from NGX_EACCES.
+                 * This means that directory searching is allowed.
+                 */
+
+                return NGX_OK;
+            }
+
             ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
                           ngx_open_file_n " \"%s\" failed", dir.data);
         }