]> git.kaiwu.me - nginx.git/commitdiff
r2182 merge:
authorIgor Sysoev <igor@sysoev.ru>
Thu, 20 Nov 2008 17:02:02 +0000 (17:02 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 20 Nov 2008 17:02:02 +0000 (17:02 +0000)
ignore NGX_EACCES error while directory test

src/http/modules/ngx_http_index_module.c

index 6bfb045650e837d10385361a365a7a7c9affdb66..01e6cd59ae19bddef8b8a0e561e15a37e8848cd6 100644 (file)
@@ -306,6 +306,19 @@ ngx_http_index_test_dir(ngx_http_request_t *r, ngx_http_core_loc_conf_t *clcf,
                 return ngx_http_index_error(r, 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);
         }