summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-01 16:12:29 +0200
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-01 16:12:29 +0200
commit81cfe85c1b8ecdd25eb2735779a9a99b6c682da4 (patch)
treefbfe571d942cb2631734b383deeeb27b54064c72 /scripts/install-system
parent90b81cf158a7ca263bf43d1bfc2fc971fcea2290 (diff)
downloadvyatta-cfg-system-81cfe85c1b8ecdd25eb2735779a9a99b6c682da4.tar.gz
vyatta-cfg-system-81cfe85c1b8ecdd25eb2735779a9a99b6c682da4.zip
Workaround problems with mkpasswd
Bugfix 3665 Fix problems with entering password caused by regressions in mkpasswd (-S arguement). Read password plaintext with shell then process.
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-xscripts/install-system16
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/install-system b/scripts/install-system
index 77384d56..8f4592f9 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -815,22 +815,20 @@ change_password() {
local pwd1="1"
local pwd2="2"
- until [ $pwd1 == $pwd2 ]
+ until [ "$pwd1" == "$pwd2" ]
do
- echo -n "Enter $user "
- pwd1=$(mkpasswd -H md5)
- local salt=$(echo $pwd1 | awk -F$ '{print $3}')
+ read -p "Enter $user password:" -r -s pwd1 <>/dev/tty 1>&0
+ echo
+ read -p "Retype $user password:" -r -s pwd2 <>/dev/tty 1>&0
+ echo
- echo -n "Retype $user "
- pwd2=$(mkpasswd -H md5 -S $salt)
-
- if [ $pwd1 != $pwd2 ]
+ if [ "$pwd1" != "$pwd2" ]
then echo "Passwords do not match"
fi
done
# escape any slashes in resulting password
- local epwd=$(echo $pwd | sed 's:/:\\/:g')
+ local epwd=$(mkpasswd -H md5 "$pwd1" | sed 's:/:\\/:g')
sed -i \
-e "/ user $user {/,/}/s/encrypted-password:.*\$/encrypted-password: \"$epwd\"/" \