Mercurial > hg > nginx
comparison src/http/modules/ngx_http_log_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 |
---|---|
392 of.min_uses = clcf->open_file_cache_min_uses; | 392 of.min_uses = clcf->open_file_cache_min_uses; |
393 of.test_dir = 1; | 393 of.test_dir = 1; |
394 of.test_only = 1; | 394 of.test_only = 1; |
395 of.errors = clcf->open_file_cache_errors; | 395 of.errors = clcf->open_file_cache_errors; |
396 of.events = clcf->open_file_cache_events; | 396 of.events = clcf->open_file_cache_events; |
397 #if (NGX_HAVE_OPENAT) | 397 |
398 of.disable_symlinks = clcf->disable_symlinks; | 398 if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { |
399 #endif | 399 /* simulate successful logging */ |
400 return len; | |
401 } | |
400 | 402 |
401 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) | 403 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) |
402 != NGX_OK) | 404 != NGX_OK) |
403 { | 405 { |
404 if (of.err == 0) { | 406 if (of.err == 0) { |
442 | 444 |
443 of.log = 1; | 445 of.log = 1; |
444 of.valid = llcf->open_file_cache_valid; | 446 of.valid = llcf->open_file_cache_valid; |
445 of.min_uses = llcf->open_file_cache_min_uses; | 447 of.min_uses = llcf->open_file_cache_min_uses; |
446 of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; | 448 of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; |
447 #if (NGX_HAVE_OPENAT) | 449 |
448 of.disable_symlinks = clcf->disable_symlinks; | 450 if (ngx_http_set_disable_symlinks(r, clcf, &log, &of) != NGX_OK) { |
449 #endif | 451 /* simulate successful logging */ |
452 return len; | |
453 } | |
450 | 454 |
451 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) | 455 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) |
452 != NGX_OK) | 456 != NGX_OK) |
453 { | 457 { |
454 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, | 458 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, |