diff options
author | Robert Nagy <robert@cvs.openbsd.org> | 2012-04-02 10:48:04 +0000 |
---|---|---|
committer | Robert Nagy <robert@cvs.openbsd.org> | 2012-04-02 10:48:04 +0000 |
commit | 7662fdd0397b31c0d769f48e6c46b6631f7130ce (patch) | |
tree | befbebe422c717e4c5ac83d91b9428c6f5529be6 /usr.sbin | |
parent | f93a01e92bdb55824725c67c3155392414a7865e (diff) |
bring back an overwritten change which is essential for the chrooted
version to strip the chroot prefix from root paths
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/nginx/src/http/ngx_http_core_module.c | 10 |
1 files changed, 9 insertions, 1 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 a27a7091688..d88d0bcb1aa 100644 --- a/usr.sbin/nginx/src/http/ngx_http_core_module.c +++ b/usr.sbin/nginx/src/http/ngx_http_core_module.c @@ -3365,6 +3365,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) { ngx_http_core_loc_conf_t *prev = parent; ngx_http_core_loc_conf_t *conf = child; + char *buf; ngx_uint_t i; ngx_hash_key_t *type; @@ -3378,12 +3379,19 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) conf->root_values = prev->root_values; if (prev->root.data == NULL) { - ngx_str_set(&conf->root, "html"); + ngx_str_set(&conf->root, "htdocs"); if (ngx_conf_full_name(cf->cycle, &conf->root, 0) != NGX_OK) { 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 (conf->post_action.data == NULL) { |