mirror of
https://github.com/nginx/nginx.git
synced 2026-07-10 02:47:15 +00:00
Core: skipped path ownership changes during configuration testing.
When the "user" directive is in effect and "nginx -t" or "nginx -T" is run by a user different from the one nginx normally runs as (notably as root, while workers run as an unprivileged packager-provided user such as "nginx" or "www-data"), ngx_create_paths() changed the ownership of the temporary directories (proxy_temp, client_body_temp, etc.) to the configured user. This left the directories owned by the wrong user for the instance that is actually running, resulting in a permission mismatch. Configuration testing is not expected to modify filesystem state, so ownership and permission changes are now skipped when ngx_test_config is set. Directories are still created as before.
This commit is contained in:
parent
ebd18ec181
commit
1571f10fad
1 changed files with 1 additions and 1 deletions
|
|
@ -614,7 +614,7 @@ ngx_create_paths(ngx_cycle_t *cycle, ngx_uid_t user)
|
|||
}
|
||||
}
|
||||
|
||||
if (user == (ngx_uid_t) NGX_CONF_UNSET_UINT) {
|
||||
if (user == (ngx_uid_t) NGX_CONF_UNSET_UINT || ngx_test_config) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue