summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-30 21:26:16 +0100
committerRoy Marples <roy@marples.name>2020-04-30 21:26:16 +0100
commitc72190790162cf2afe51feacf76be4154b215d3d (patch)
treec5c6691fccbf1fe59ed501e7feccfef9040f3529 /configure
parentcc2d257183f1a70c013a451d6b16cd061e6e5975 (diff)
downloaddhcpcd-c72190790162cf2afe51feacf76be4154b215d3d.tar.xz
privsep: allow --chrootdir= to configure a default chroot directory
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure b/configure
index 3e2e20fd..a7ae9241 100755
--- a/configure
+++ b/configure
@@ -13,6 +13,7 @@ IPV4LL=
INET6=
PRIVSEP=
PRIVSEP_USER=
+PRIVSEP_CHROOT=
ARC4RANDOM=
CLOSEFROM=
RBTREE=
@@ -71,6 +72,7 @@ for x do
--disable-privsep) PRIVSEP=no;;
--enable-privsep) PRIVSEP=yes;;
--privsepuser) PRIVSEP_USER=$var;;
+ --chrootdir) PRIVSEP_CHROOT=$var;;
--prefix) PREFIX=$var;;
--sysconfdir) SYSCONFDIR=$var;;
--bindir|--sbindir) SBINDIR=$var;;
@@ -579,9 +581,17 @@ if [ "$PRIVSEP" = yes ]; then
echo "CPPFLAGS+= -DPRIVSEP" >>$CONFIG_MK
echo "PRIVSEP_USER?= $PRIVSEP_USER" >>$CONFIG_MK
+ if [ -n "$PRIVSEP_CHROOT" ]; then
+ echo "PRIVSEP_CHROOT= $PRIVSEP_CHROOT" >>$CONFIG_MK
+ fi
echo "#ifndef PRIVSEP_USER" >>$CONFIG_H
echo "#define PRIVSEP_USER \"$PRIVSEP_USER\"" >>$CONFIG_H
echo "#endif" >>$CONFIG_H
+ if [ -n "$PRIVSEP_CHROOT" ]; then
+ echo "#ifndef PRIVSEP_CHROOT" >>$CONFIG_H
+ echo "#define PRIVSEP_CHROOT \"$PRIVSEP_CHROOT\"" >>$CONFIG_H
+ echo "#endif" >>$CONFIG_H
+ fi
echo "DHCPCD_SRCS+= privsep.c privsep-root.c privsep-inet.c" \
>>$CONFIG_MK
if [ -z "$INET" ] || [ "$INET" = yes ]; then