summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nginx/src
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2011-10-05 18:04:18 +0000
committerrobert <robert@openbsd.org>2011-10-05 18:04:18 +0000
commit23a619e04010253b9bdeb5e1d1ff335dafa59076 (patch)
tree162ae4b8ead617b1337869a477969e2b3e5baf9b /usr.sbin/nginx/src
parentrestart connect(2) if it returns EINTR (diff)
downloadwireguard-openbsd-23a619e04010253b9bdeb5e1d1ff335dafa59076.tar.xz
wireguard-openbsd-23a619e04010253b9bdeb5e1d1ff335dafa59076.zip
Since the worker process of nginx is chrooted on OpenBSD, let's remove
down the prefix of nginx which is /var/www from the file paths when the worker process tries to reopen files (access.log, error.log, etc.). This fixes the 'nginx -s reopen' issue which was reported by some users.
Diffstat (limited to 'usr.sbin/nginx/src')
-rw-r--r--usr.sbin/nginx/src/core/ngx_cycle.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/nginx/src/core/ngx_cycle.c b/usr.sbin/nginx/src/core/ngx_cycle.c
index 968056c42e6..ed25006e390 100644
--- a/usr.sbin/nginx/src/core/ngx_cycle.c
+++ b/usr.sbin/nginx/src/core/ngx_cycle.c
@@ -1136,6 +1136,10 @@ ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user)
len = file[i].pos - file[i].buffer;
+ if (ngx_process == NGX_PROCESS_WORKER)
+ ngx_cpystrn(file[i].name.data, file[i].name.data + strlen(NGX_PREFIX),
+ file[i].name.len);
+
if (file[i].buffer && len != 0) {
n = ngx_write_fd(file[i].fd, file[i].buffer, len);