diff options
Diffstat (limited to 'src/http/modules/ngx_http_log_module.c')
-rw-r--r-- | src/http/modules/ngx_http_log_module.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c index da3b33c96..737a772d6 100644 --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -394,9 +394,11 @@ ngx_http_log_script_write(ngx_http_request_t *r, ngx_http_log_script_t *script, 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) { + /* simulate successful logging */ + return len; + } if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -444,9 +446,11 @@ ngx_http_log_script_write(ngx_http_request_t *r, ngx_http_log_script_t *script, of.valid = llcf->open_file_cache_valid; of.min_uses = llcf->open_file_cache_min_uses; of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + + if (ngx_http_set_disable_symlinks(r, clcf, &log, &of) != NGX_OK) { + /* simulate successful logging */ + return len; + } if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) != NGX_OK) |