diff options
author | 2010-01-17 19:32:40 +0000 | |
---|---|---|
committer | 2010-01-17 19:32:40 +0000 | |
commit | fe5b952965b4c08b1fded64b3721c9a73d9e98a3 (patch) | |
tree | 7ba520c3aeb17928796c45843416da3d0c089c31 | |
parent | While resampling, if input samples are available but output (diff) | |
download | wireguard-openbsd-fe5b952965b4c08b1fded64b3721c9a73d9e98a3.tar.xz wireguard-openbsd-fe5b952965b4c08b1fded64b3721c9a73d9e98a3.zip |
add --with-chroot option to set default chroot directory
-rw-r--r-- | usr.sbin/nsd/configure.ac | 10 | ||||
-rw-r--r-- | usr.sbin/nsd/nsd.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/usr.sbin/nsd/configure.ac b/usr.sbin/nsd/configure.ac index ccabe1462c9..a16176758c1 100644 --- a/usr.sbin/nsd/configure.ac +++ b/usr.sbin/nsd/configure.ac @@ -123,6 +123,16 @@ AC_DEFINE_UNQUOTED(XFRDFILE, ["`eval echo $xfrdfile`"], [Pathname to the NSD xfr AC_SUBST(xfrdfile) # +# Determine default chroot directory +# +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.]) + +# # Determine the user name to drop privileges to # user=nsd diff --git a/usr.sbin/nsd/nsd.c b/usr.sbin/nsd/nsd.c index 708d897fcfd..b223a1f28b8 100644 --- a/usr.sbin/nsd/nsd.c +++ b/usr.sbin/nsd/nsd.c @@ -649,6 +649,7 @@ main(int argc, char *argv[]) #endif /* BIND8_STATS */ #ifdef HAVE_CHROOT if(nsd.chrootdir == 0) nsd.chrootdir = nsd.options->chroot; + if(nsd.chrootdir == 0) nsd.chrootdir = strdup(CHROOTDIR); #endif /* HAVE_CHROOT */ if(nsd.username == 0) { if(nsd.options->username) nsd.username = nsd.options->username; |