changeset 5136:0fea55d03199 draft

Revert "privsep: default to using _dhcpcd and not _dhcp" This reverts commit 36c47a8df0951236a7842bbf8241e2932357ef61.
author Roy Marples <roy@marples.name>
date Sun, 05 Apr 2020 15:52:50 +0100
parents 29f6e6bb802e
children bca739d216a7
files configure
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Fri Apr 10 10:17:38 2020 +0100
+++ b/configure	Sun Apr 05 15:52:50 2020 +0100
@@ -555,7 +555,18 @@
 
 if [ "$PRIVSEP" = yes ]; then
 	echo "Enabling Privilege 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