summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2010-02-24 07:36:04 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2010-02-24 07:36:04 +0000
commit41df76c1af1af731e610f52b61dc5b8b8d902552 (patch)
treec5704e2a1661f5198d2c961938d7f5c4197b40eb /usr.sbin
parentf41ab3e79d3c67e20c6eabc02eef5cc56fd6b6ca (diff)
better default chroot
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/nsd/configure.ac7
-rw-r--r--usr.sbin/nsd/nsd.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/nsd/configure.ac b/usr.sbin/nsd/configure.ac
index a16176758c1..a534a464d6b 100644
--- a/usr.sbin/nsd/configure.ac
+++ b/usr.sbin/nsd/configure.ac
@@ -128,9 +128,10 @@ AC_SUBST(xfrdfile)
chrootdir="/"
AC_ARG_WITH([chroot],
AC_HELP_STRING([--with-chroot=dir], [NSD default chroot directory]),
- [chrootdir=$withval])
-AC_SUBST(chrootdir)
-AC_DEFINE_UNQUOTED(CHROOTDIR, ["`eval echo $chrootdir`"], [NSD default chroot directory.])
+ [
+ chrootdir=$withval
+ AC_DEFINE_UNQUOTED(CHROOTDIR, ["`eval echo $chrootdir`"], [NSD default chroot directory.])
+ ])
#
# Determine the user name to drop privileges to
diff --git a/usr.sbin/nsd/nsd.c b/usr.sbin/nsd/nsd.c
index 8dac3bf0f79..d5afe8c11b0 100644
--- a/usr.sbin/nsd/nsd.c
+++ b/usr.sbin/nsd/nsd.c
@@ -649,7 +649,9 @@ main(int argc, char *argv[])
#endif /* BIND8_STATS */
#ifdef HAVE_CHROOT
if(nsd.chrootdir == 0) nsd.chrootdir = nsd.options->chroot;
+#ifdef CHROOTDIR
if(nsd.chrootdir == 0) nsd.chrootdir = strdup(CHROOTDIR);
+#endif /* CHROOTDIR */
#endif /* HAVE_CHROOT */
if(nsd.username == 0) {
if(nsd.options->username) nsd.username = nsd.options->username;