Fix logic error in vhost chrooting (from e592bbc
)
Thanks Hiltjo for having spotted it!
This commit is contained in:
parent
d7f5c6029e
commit
21115d4a1b
1 changed files with 6 additions and 3 deletions
9
quark.c
9
quark.c
|
@ -568,9 +568,12 @@ sendresponse(int fd, struct request *r)
|
||||||
for (i = 0; i < LEN(vhost); i++) {
|
for (i = 0; i < LEN(vhost); i++) {
|
||||||
/* switch to vhost directory if there is a match */
|
/* switch to vhost directory if there is a match */
|
||||||
if (!regexec(&vhost[i].re, r->field[REQ_HOST], 0,
|
if (!regexec(&vhost[i].re, r->field[REQ_HOST], 0,
|
||||||
NULL, 0) && chdir(vhost[i].dir) < 0) {
|
NULL, 0) {
|
||||||
return sendstatus(fd, (errno == EACCES) ?
|
if (chdir(vhost[i].dir) < 0) {
|
||||||
S_FORBIDDEN : S_NOT_FOUND);
|
return sendstatus(fd, (errno == EACCES)
|
||||||
|
? S_FORBIDDEN : S_NOT_FOUND);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue