aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_open_file_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_open_file_cache.c')
-rw-r--r--src/core/ngx_open_file_cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c
index 9ce0308ce..7dd968f36 100644
--- a/src/core/ngx_open_file_cache.c
+++ b/src/core/ngx_open_file_cache.c
@@ -678,7 +678,9 @@ ngx_open_file_wrapper(ngx_str_t *name, ngx_open_file_info_t *of,
goto failed;
}
- if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) {
+ if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER
+ && !(create & (NGX_FILE_CREATE_OR_OPEN|NGX_FILE_TRUNCATE)))
+ {
fd = ngx_openat_file_owner(at_fd, p, mode, create, access, log);
} else {