diff src/http/modules/ngx_http_index_module.c @ 4494:13e09cf11d4e

Disable symlinks: initialization of the "disable_symlinks" field in ngx_open_file_info_t moved to a separate function. This is preparation for the "from=" parameter implementation of the "disable_symlinks" directive.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 27 Feb 2012 16:51:28 +0000
parents 08713bac87fc
children 778ef9c3fd2d
line wrap: on
line diff
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -209,9 +209,10 @@ ngx_http_index_handler(ngx_http_request_
         of.test_only = 1;
         of.errors = clcf->open_file_cache_errors;
         of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
-        of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+        if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
+        }
 
         if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
             != NGX_OK)
@@ -307,9 +308,10 @@ ngx_http_index_test_dir(ngx_http_request
     of.test_only = 1;
     of.valid = clcf->open_file_cache_valid;
     of.errors = clcf->open_file_cache_errors;
-#if (NGX_HAVE_OPENAT)
-    of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+    if (ngx_http_set_disable_symlinks(r, clcf, &dir, &of) != NGX_OK) {
+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
+    }
 
     if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool)
         != NGX_OK)