summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nsd/nsd.c
diff options
context:
space:
mode:
authorjakob <jakob@openbsd.org>2010-02-24 14:03:31 +0000
committerjakob <jakob@openbsd.org>2010-02-24 14:03:31 +0000
commitb3414a7c466ce2a4b6ed4888e93e42456ee50ebc (patch)
tree006e2aed7a5221b4f33bfc96b51a93f0112e6cbd /usr.sbin/nsd/nsd.c
parentfix SEE ALSO; (diff)
downloadwireguard-openbsd-b3414a7c466ce2a4b6ed4888e93e42456ee50ebc.tar.xz
wireguard-openbsd-b3414a7c466ce2a4b6ed4888e93e42456ee50ebc.zip
exit if paths are not relative to chroot
Diffstat (limited to 'usr.sbin/nsd/nsd.c')
-rw-r--r--usr.sbin/nsd/nsd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/usr.sbin/nsd/nsd.c b/usr.sbin/nsd/nsd.c
index d5afe8c11b0..8156cb78b6e 100644
--- a/usr.sbin/nsd/nsd.c
+++ b/usr.sbin/nsd/nsd.c
@@ -830,21 +830,17 @@ main(int argc, char *argv[])
}
if (strncmp(nsd.chrootdir, nsd.pidfile, l) != 0) {
- log_msg(LOG_ERR, "%s is not relative to %s: will not chroot",
+ error("%s is not relative to %s: chroot not possible",
nsd.pidfile, nsd.chrootdir);
- nsd.chrootdir = NULL;
} else if (strncmp(nsd.chrootdir, nsd.dbfile, l) != 0) {
- log_msg(LOG_ERR, "%s is not relative to %s: will not chroot",
+ error("%s is not relative to %s: chroot not possible",
nsd.dbfile, nsd.chrootdir);
- nsd.chrootdir = NULL;
} else if (strncmp(nsd.chrootdir, nsd.options->xfrdfile, l) != 0) {
- log_msg(LOG_ERR, "%s is not relative to %s: will not chroot",
+ error("%s is not relative to %s: chroot not possible",
nsd.options->xfrdfile, nsd.chrootdir);
- nsd.chrootdir = NULL;
} else if (strncmp(nsd.chrootdir, nsd.options->difffile, l) != 0) {
- log_msg(LOG_ERR, "%s is not relative to %s: will not chroot",
+ error("%s is not relative to %s: chroot not possible",
nsd.options->difffile, nsd.chrootdir);
- nsd.chrootdir = NULL;
}
}