diff options
| author | 2012-04-02 14:58:46 +0000 | |
|---|---|---|
| committer | 2012-04-02 14:58:46 +0000 | |
| commit | 6dc85640a9fb69b362f2c36d365ddb41966a63aa (patch) | |
| tree | e3edefae6b18fa1340fe270d2a848004357df0de /usr.sbin/nginx/src | |
| parent | In r1.2, instead of making -fno-ident the default, its semantics have been (diff) | |
| download | wireguard-openbsd-6dc85640a9fb69b362f2c36d365ddb41966a63aa.tar.xz wireguard-openbsd-6dc85640a9fb69b362f2c36d365ddb41966a63aa.zip | |
make sure we strip the chroot prefix from all root variables, not just the
first one
Diffstat (limited to 'usr.sbin/nginx/src')
| -rw-r--r-- | usr.sbin/nginx/src/http/ngx_http_core_module.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/nginx/src/http/ngx_http_core_module.c b/usr.sbin/nginx/src/http/ngx_http_core_module.c index d88d0bcb1aa..400db3ce7df 100644 --- a/usr.sbin/nginx/src/http/ngx_http_core_module.c +++ b/usr.sbin/nginx/src/http/ngx_http_core_module.c @@ -3385,13 +3385,14 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) return NGX_CONF_ERROR; } } - if (ngx_chrooted) { - buf = malloc(conf->root.len); - ngx_cpystrn(buf, conf->root.data + strlen(NGX_PREFIX) - 1, - conf->root.len); - ngx_str_set(&conf->root, buf); - free(buf); - } + } + + if (ngx_chrooted && prev->root.data != NULL) { + buf = malloc(conf->root.len); + ngx_cpystrn(buf, conf->root.data + strlen(NGX_PREFIX) - 1, + conf->root.len); + ngx_str_set(&conf->root, buf); + free(buf); } if (conf->post_action.data == NULL) { |
