From 04e94b32b029cd25e4d519cb800fbd623421da9a Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 16 May 2020 12:45:42 +0800 Subject: [PATCH] nrelease: Use pw(8) and chpass(1) to setup 'installer' and 'root' users Use pw(8) to add the 'installer' user and use chpass(1) to disable passwords for the 'installer' and 'root' users. So we can drop the customized 'master.passwd' file and be in sync with the one in usr/src/etc. --- nrelease/Makefile | 6 ++++++ nrelease/gui/etc/master.passwd | 25 ------------------------- nrelease/gui/etc/passwd | 25 ------------------------- nrelease/root/etc/master.passwd | 25 ------------------------- 4 files changed, 6 insertions(+), 75 deletions(-) delete mode 100644 nrelease/gui/etc/master.passwd delete mode 100644 nrelease/gui/etc/passwd delete mode 100644 nrelease/root/etc/master.passwd diff --git a/nrelease/Makefile b/nrelease/Makefile index 1f8f1ff7a1..3b7801fe62 100644 --- a/nrelease/Makefile +++ b/nrelease/Makefile @@ -225,7 +225,13 @@ customizeiso: @test -O ${.CURDIR} || echo "chowning copied files to root:wheel" @test -O ${.CURDIR} || ((cd ${ROOTSKEL} && find .) | fgrep -v cpignore | (cd ${ISOROOT} && xargs chown root:wheel)) .endfor + pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd + pw -V ${ISOROOT}/etc useradd installer -o -u 0 -g 0 \ + -c "DragonFly Installer" -d /root -s /usr/sbin/installer + ${CHROOT_CMD} "chpass -p '' root" + ${CHROOT_CMD} "chpass -p '' installer" + .for UPGRADE_ITEM in Makefile \ etc.${MACHINE_ARCH} \ rc.d/Makefile \ diff --git a/nrelease/gui/etc/master.passwd b/nrelease/gui/etc/master.passwd deleted file mode 100644 index 41feffdf5f..0000000000 --- a/nrelease/gui/etc/master.passwd +++ /dev/null @@ -1,25 +0,0 @@ -root::0:0::0:0:Charlie &:/root:/bin/csh -toor:*:0:0::0:0:Bourne-again Superuser:/root: -installer::0:0::0:0:Bourne-again Superuser:/root:/usr/sbin/installer -daemon:*:1:1::0:0:Owner of many system processes:/root:/sbin/nologin -operator:*:2:5::0:0:System &:/:/sbin/nologin -bin:*:3:7::0:0:Binaries Commands and Source:/:/sbin/nologin -tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin -kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin -mail:*:6:6::0:0:Mail user:/nonexistent:/sbin/nologin -games:*:7:13::0:0:Games pseudo-user:/usr/games:/sbin/nologin -news:*:8:8::0:0:News Subsystem:/:/sbin/nologin -man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/sbin/nologin -sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/sbin/nologin -smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/sbin/nologin -mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/sbin/nologin -bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin -proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/sbin/nologin -_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/sbin/nologin -uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico -xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin -pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin -_sdpd:*:70:70::0:0:sdpd privsep user:/var/empty:/sbin/nologin -_dhcp:*:77:77::0:0:DHCP programs:/var/empty:/sbin/nologin -www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/sbin/nologin -nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin diff --git a/nrelease/gui/etc/passwd b/nrelease/gui/etc/passwd deleted file mode 100644 index 7ae3991aaa..0000000000 --- a/nrelease/gui/etc/passwd +++ /dev/null @@ -1,25 +0,0 @@ -root:*:0:0:Charlie &:/root:/usr/pkg/bin/zsh -toor:*:0:0:Bourne-again Superuser:/root: -installer:*:0:0:Bourne-again Superuser:/root:/usr/sbin/installer -daemon:*:1:1:Owner of many system processes:/root:/sbin/nologin -operator:*:2:5:System &:/:/sbin/nologin -bin:*:3:7:Binaries Commands and Source:/:/sbin/nologin -tty:*:4:65533:Tty Sandbox:/:/sbin/nologin -kmem:*:5:65533:KMem Sandbox:/:/sbin/nologin -mail:*:6:6:Mail user:/nonexistent:/sbin/nologin -games:*:7:13:Games pseudo-user:/usr/games:/sbin/nologin -news:*:8:8:News Subsystem:/:/sbin/nologin -man:*:9:9:Mister Man Pages:/usr/share/man:/sbin/nologin -sshd:*:22:22:Secure Shell Daemon:/var/empty:/sbin/nologin -smmsp:*:25:25:Sendmail Submission User:/var/spool/clientmqueue:/sbin/nologin -mailnull:*:26:26:Sendmail Default User:/var/spool/mqueue:/sbin/nologin -bind:*:53:53:Bind Sandbox:/:/sbin/nologin -proxy:*:62:62:Packet Filter pseudo-user:/nonexistent:/sbin/nologin -_pflogd:*:64:64:pflogd privsep user:/var/empty:/sbin/nologin -uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico -xten:*:67:67:X-10 daemon:/usr/local/xten:/sbin/nologin -pop:*:68:6:Post Office Owner:/nonexistent:/sbin/nologin -_sdpd:*:70:70:sdpd privsep user:/var/empty:/sbin/nologin -_dhcp:*:77:77:DHCP programs:/var/empty:/sbin/nologin -www:*:80:80:World Wide Web Owner:/nonexistent:/sbin/nologin -nobody:*:65534:65534:Unprivileged user:/nonexistent:/sbin/nologin diff --git a/nrelease/root/etc/master.passwd b/nrelease/root/etc/master.passwd deleted file mode 100644 index 41feffdf5f..0000000000 --- a/nrelease/root/etc/master.passwd +++ /dev/null @@ -1,25 +0,0 @@ -root::0:0::0:0:Charlie &:/root:/bin/csh -toor:*:0:0::0:0:Bourne-again Superuser:/root: -installer::0:0::0:0:Bourne-again Superuser:/root:/usr/sbin/installer -daemon:*:1:1::0:0:Owner of many system processes:/root:/sbin/nologin -operator:*:2:5::0:0:System &:/:/sbin/nologin -bin:*:3:7::0:0:Binaries Commands and Source:/:/sbin/nologin -tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin -kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin -mail:*:6:6::0:0:Mail user:/nonexistent:/sbin/nologin -games:*:7:13::0:0:Games pseudo-user:/usr/games:/sbin/nologin -news:*:8:8::0:0:News Subsystem:/:/sbin/nologin -man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/sbin/nologin -sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/sbin/nologin -smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/sbin/nologin -mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/sbin/nologin -bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin -proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/sbin/nologin -_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/sbin/nologin -uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico -xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin -pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin -_sdpd:*:70:70::0:0:sdpd privsep user:/var/empty:/sbin/nologin -_dhcp:*:77:77::0:0:DHCP programs:/var/empty:/sbin/nologin -www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/sbin/nologin -nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin -- 2.41.0