summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2021-01-24 23:03:25 +0100
committer Eric Hameleers <alien@slackware.com>2021-01-24 23:03:25 +0100
commit0413244da62352b9126920064ac0fbaa274e6a5f (patch)
treeadca6e77be8aff9d01017d0584a71c6522c3b9cb
parent7ffc57a1f89f49964920cb5cb2e75b776217c198 (diff)
downloadliveslak-0413244da62352b9126920064ac0fbaa274e6a5f.tar.gz
liveslak-0413244da62352b9126920064ac0fbaa274e6a5f.tar.xz
Use 'chpassword -R' instead of chrooting
According to bug report, this is now needed on Slackware 14.2 when generating a -current Live ISO. PAM is probably to blame: >chpasswd: (user root) pam_chauthtok() failed, error: >Authentication token manipulation error >chpasswd: (line 1, user root) password not changed
-rwxr-xr-xmake_slackware_live.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index 8a6b8e3..50fabc7 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -1632,14 +1632,14 @@ KERNEL=="loop*", ENV{UDISKS_IGNORE}="1"
EOL
# Set a root password.
-echo "root:${ROOTPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+echo "root:${ROOTPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR}
# Create group and user for the nvidia persistence daemon:
if ! chroot ${LIVE_ROOTDIR} /usr/bin/getent passwd ${NVUID} > /dev/null 2>&1 ;
then
chroot ${LIVE_ROOTDIR} /usr/sbin/groupadd -g ${NVGRPNR} ${NVGRP}
chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Nvidia persistence" -u ${NVUIDNR} -g ${NVGRPNR} -d /dev/null -s /bin/false ${NVUID}
- echo "${NVUID}:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+ echo "${NVUID}:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR}
fi
# Determine the full name of the live account in the image:
@@ -1652,7 +1652,7 @@ fi
# Create a nonprivileged user account (called "live" by default):
chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "${LIVEUIDFN}" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,kmem,dialout,games,disk,input -u ${LIVEUIDNR} -d /home/${LIVEUID} -m -s /bin/bash ${LIVEUID}
-echo "${LIVEUID}:${LIVEPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+echo "${LIVEUID}:${LIVEPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR}
# Configure suauth if we are not on a PAM system (where this does not work):
if [ ! -L ${LIVE_ROOTDIR}/lib${DIRSUFFIX}/libpam.so.? ]; then
@@ -2577,7 +2577,7 @@ if [ "$LIVEDE" = "STUDIOWARE" ]; then
# Create group and user for the Avahi service:
chroot ${LIVE_ROOTDIR} /usr/sbin/groupadd -g 214 avahi
chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Avahi Service Account" -u 214 -g 214 -d /dev/null -s /bin/false avahi
- echo "avahi:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+ echo "avahi:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR}
fi # End LIVEDE = STUDIOWARE