From e96b0a6cda96a77147ce977e3f050f61b7e5d573 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sun, 19 Apr 2009 00:02:34 +0200 Subject: [PATCH] 'change root pw to real dialog' --- usr/share/archboot/installer/setup | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/usr/share/archboot/installer/setup b/usr/share/archboot/installer/setup index c4ac724a9..cf92e3fd0 100755 --- a/usr/share/archboot/installer/setup +++ b/usr/share/archboot/installer/setup @@ -1115,9 +1115,9 @@ _luks() done LUKSPASSPHRASE="" while [ "${LUKSPASSPHRASE}" = "" ]; do - DIALOG --insecure --passwordbox "Enter passphrase below:" 0 0 2>$ANSWER || return 1 + DIALOG --insecure --passwordbox "Enter passphrase:" 0 0 2>$ANSWER || return 1 LUKSPASS=$(cat $ANSWER) - DIALOG --insecure --passwordbox "Retype passphrase below:" 0 0 2>$ANSWER || return 1 + DIALOG --insecure --passwordbox "Retype passphrase:" 0 0 2>$ANSWER || return 1 LUKSPASS2=$(cat $ANSWER) if [ "$LUKSPASS" = "$LUKSPASS2" ]; then LUKSPASSPHRASE=$LUKSPASS @@ -2723,9 +2723,23 @@ configure_system() done $EDITOR ${DESTDIR}${FILE} elif [ "$FILE" = "Root-Password" ]; then # non-file - while true; do - chroot ${DESTDIR} passwd root && break + PASSWORD="" + while [ "${PASSWORD}" = "" ]; do + DIALOG --insecure --passwordbox "Enter root password:" 0 0 2>$ANSWER || return 1 + PASS=$(cat $ANSWER) + DIALOG --insecure --passwordbox "Retype root password:" 0 0 2>$ANSWER || return 1 + PASS2=$(cat $ANSWER) + if [ "$PASS" = "$PASS2" ]; then + PASSWORD=$PASS + echo $PASSWORD > /tmp/.password + echo $PASSWORD > /tmp/.password + PASSWORD=/tmp/.password + else + DIALOG --msgbox "Password didn't match, please enter again." 0 0 + fi done + chroot ${DESTDIR} passwd root < /tmp/.password + rm /tmp/.password elif [ "$FILE" = "Pacman-Mirror" ]; then # non-file do_pacmanmirror else #regular file