From: Christian Hofstaedtler Date: Mon, 18 Oct 2010 12:17:57 +0000 (+0200) Subject: remove bashism "read -s" from chroot-script X-Git-Tag: v0.39~2 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=fc4a1cdb9f4b022a4f7ff5e292ad9e20e0ca6df6 remove bashism "read -s" from chroot-script chroot-script runs in target, which might very well use dash, which doesn't have "read -s". Patch based on mira's recommendations. --- diff --git a/chroot-script b/chroot-script index bbd834f..b5e60b4 100755 --- a/chroot-script +++ b/chroot-script @@ -42,6 +42,15 @@ stage() { echo " Executing stage ${1}" return 0 } + +askpass() { + # read -s emulation for dash. result is in $resp. + set -o noglob + stty -echo + read resp + stty echo + set +o noglob +} # }}} # define chroot mirror {{{ @@ -227,10 +236,14 @@ passwords() echo "Setting password for user root:" while [ "$a" != "$b" ] ; do echo -n "Enter new UNIX password for user root: " - read -s a + askpass + a="$resp" + unset resp echo echo -n "Retype new UNIX password for user root: " - read -s b + askpass + b="$resp" + unset resp echo if [ "$a" != "$b" ] ; then echo "Sorry, passwords do not match. Retry." diff --git a/debian/changelog b/debian/changelog index e00510a..2683195 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,10 @@ grml-debootstrap (0.39) UNRELEASED; urgency=low [ Tong Sun ] * remove 'umount -a' in bailout(). [Closes: issue806]. - -- Michael Prokop Wed, 09 Jun 2010 11:44:05 +0200 + [ Christian Hofstaedtler ] + * Remove "read -s" bashism from target chroot script. [Closes: issue912]. + + -- Christian Hofstaedtler Mon, 18 Oct 2010 12:33:49 +0000 grml-debootstrap (0.38) unstable; urgency=low