]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
dhcpcd: create dhcpcd user and chroot folder
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 19 Apr 2020 17:18:04 +0000 (19:18 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 19 Apr 2020 17:27:23 +0000 (17:27 +0000)
dhcpcd 9.x adds privelege seperation by creating a chroot
and running parts of the client not as root.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/etc/group
config/etc/passwd
src/initscripts/system/mountkernfs

index 4855214be0e19cd24e41c968ff00cf2dee497a34..f1767b30cd99e69bacfc2cc6a52015040e170b3c 100644 (file)
@@ -20,6 +20,7 @@ dip:x:40:
 ftp:x:45:
 rsyncd:x:48:
 stunnel:x:51:
+dhcpcd:x:52:
 lock:x:54:
 sshd:x:74:
 pcap:x:77:
index 7893b43c97e869988debfc1f5520a6cca3672c6a..cb0428085192af305a5f79ce8912cd264c3fdcfd 100644 (file)
@@ -7,6 +7,7 @@ ntp:x:38:38::/etc/ntp:/bin/false
 ftp:x:45:45:anonymous_user:/home/ftp:/bin/false
 rsyncd:x:48:48:rsyncd Daemon:/home/rsync:/bin/false
 stunnel:x:51:51:stunnel Daemon:/var/lib/stunnel:/bin/false
+dhcpcd:x:52:52:dhcpcd privsep user:/run/dhcpcd/chroot:/bin/false
 sshd:x:74:74:sshd:/var/empty:/bin/false
 nobody:x:99:99:Nobody:/home/nobody:/bin/false
 postfix:x:100:100::/var/spool/postfix:/bin/false
index f7be82d01e5097e158a8cf032743f756d196ebdc..f0bfc52890e36d63bdf7d1546d2a6a20d2895ae1 100644 (file)
@@ -34,6 +34,11 @@ case "${1}" in
                        mount -n -t tmpfs -o nosuid,nodev,mode=755,size=8M /run /run || failed=1
                fi
 
+               # create folder for dhcpcd changeroot
+               mkdir -p /run/dhcpcd/chroot
+               chown dhcpcd:dhcpcd /run/dhcpcd/chroot
+               chmod 750 /run/dhcpcd/chroot
+
                boot_mesg "" ${NORMAL}
 
                (exit ${failed})