diff options
| author | 2012-04-02 10:48:03 +0000 | |
|---|---|---|
| committer | 2012-04-02 10:48:03 +0000 | |
| commit | 71cf715783ac63a0714168a7fc9d20260f4c97bc (patch) | |
| tree | 3a5c46e7735ddd9d8020a1ecdc06d9f8972cec79 /usr.sbin/nginx/src | |
| parent | sync (diff) | |
| download | wireguard-openbsd-71cf715783ac63a0714168a7fc9d20260f4c97bc.tar.xz wireguard-openbsd-71cf715783ac63a0714168a7fc9d20260f4c97bc.zip | |
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/nginx/src')
| -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) { |
