Another auth/location question - probably very simple to fix :)

Igor Sysoev is at rambler-co.ru
Sat Aug 16 21:50:58 MSD 2008


On Sat, Aug 16, 2008 at 02:43:00AM -0700, mike wrote:

> and i want to ask a clarification: will maxim's patch be adopted
> as-is, and if people don't like that behavior they have the option to
> set the open_file_cache_errors option? i am trying to figure out if it
> will behave how i want by default, or if i am the one that needs to
> make a config change :)

No, open_file_cache_errors has not direct relatin to index files.
It simply way to decrease number of syscalls using cache while testing
index files.

As to patch, after looking the code, I have found that EACESS at this
point should be ignored. Here is my patch (the same as Maxim's one)
with comment. Could you or someone test English part of patch ?


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/modules/ngx_http_index_module.c
===================================================================
--- src/http/modules/ngx_http_index_module.c	(revision 1500)
+++ src/http/modules/ngx_http_index_module.c	(working copy)
@@ -309,6 +309,19 @@
                 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);
         }


More information about the nginx mailing list