summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2012-04-02 14:58:47 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2012-04-02 14:58:47 +0000
commit7fed5306bde358cbc314371d9e53e00d281d8f7c (patch)
treefa1d2a0d439b051345685a592c0a87c1b99786e7 /usr.sbin
parent02d60c61e667d632d4ce9ace75d7d0ddc682a77e (diff)
make sure we strip the chroot prefix from all root variables, not just the
first one
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/nginx/src/http/ngx_http_core_module.c15
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) {