comparison 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
comparison
equal deleted inserted replaced
4493:47ece8818978 4494:13e09cf11d4e
207 of.valid = clcf->open_file_cache_valid; 207 of.valid = clcf->open_file_cache_valid;
208 of.min_uses = clcf->open_file_cache_min_uses; 208 of.min_uses = clcf->open_file_cache_min_uses;
209 of.test_only = 1; 209 of.test_only = 1;
210 of.errors = clcf->open_file_cache_errors; 210 of.errors = clcf->open_file_cache_errors;
211 of.events = clcf->open_file_cache_events; 211 of.events = clcf->open_file_cache_events;
212 #if (NGX_HAVE_OPENAT) 212
213 of.disable_symlinks = clcf->disable_symlinks; 213 if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
214 #endif 214 return NGX_HTTP_INTERNAL_SERVER_ERROR;
215 }
215 216
216 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) 217 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
217 != NGX_OK) 218 != NGX_OK)
218 { 219 {
219 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err, 220 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err,
305 306
306 of.test_dir = 1; 307 of.test_dir = 1;
307 of.test_only = 1; 308 of.test_only = 1;
308 of.valid = clcf->open_file_cache_valid; 309 of.valid = clcf->open_file_cache_valid;
309 of.errors = clcf->open_file_cache_errors; 310 of.errors = clcf->open_file_cache_errors;
310 #if (NGX_HAVE_OPENAT) 311
311 of.disable_symlinks = clcf->disable_symlinks; 312 if (ngx_http_set_disable_symlinks(r, clcf, &dir, &of) != NGX_OK) {
312 #endif 313 return NGX_HTTP_INTERNAL_SERVER_ERROR;
314 }
313 315
314 if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool) 316 if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool)
315 != NGX_OK) 317 != NGX_OK)
316 { 318 {
317 if (of.err) { 319 if (of.err) {