]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Support the generic _dhcp entry on DragonFly
authorRoy Marples <roy@marples.name>
Wed, 18 Dec 2019 14:37:01 +0000 (14:37 +0000)
committerRoy Marples <roy@marples.name>
Wed, 18 Dec 2019 14:38:03 +0000 (14:38 +0000)
No need to create a specific _dhcpcd user in this instance.

configure

index e78370abd25d446b45fe6c4da03efc72aded9da5..0cb27ce147988582f44dd26de0f3dc9b9c0bf913 100755 (executable)
--- a/configure
+++ b/configure
@@ -12,7 +12,7 @@ ARPING=
 IPV4LL=
 INET6=
 PRIVSEP=
-PRIVSEP_USER=_dhcpcd
+PRIVSEP_USER=
 ARC4RANDOM=
 CLOSEFROM=
 RBTREE=
@@ -539,6 +539,18 @@ fi
 
 if [ "$PRIVSEP" = yes ]; then
        echo "Enabling Priviledge Separation"
+
+       # Try and work out a user
+       if [ -z "$PRIVSEP_USER" ]; then
+               for x in _dhcpcd _dhcp; do
+                       if id "$x" 2>/dev/null >&2; then
+                               PRIVSEP_USER="$x"
+                               break
+                       fi
+               done
+       fi
+       : ${PRIVSEP_USER:= _dhcpcd}
+
        echo "CPPFLAGS+=        -DPRIVSEP" >>$CONFIG_MK
        echo "#ifndef PRIVSEP_USER" >>$CONFIG_H
        echo "#define PRIVSEP_USER               \"$PRIVSEP_USER\"" >>$CONFIG_H