]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2002-06-12 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Wed, 12 Jun 2002 08:39:50 +0000 (08:39 +0000)
committerokuji <okuji@localhost>
Wed, 12 Jun 2002 08:39:50 +0000 (08:39 +0000)
* util/grub-md5-crypt.in: Prompt to retype a password, and check
if the passwords matches. Suggested by Matt Perry
<matt@primefactor.com>.
Also, don't use Perl any longer, because *BSD's sh and GNU
support ``read -r'', and GRUB doesn't support any other
operating system anyway.

ChangeLog
THANKS
util/grub-md5-crypt.in

index afbfdaa5a6eeb91bcc557d6287508bff8aab04b1..f25f23b1a3f731f462f96e4e3d5ad7cc944a487f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-06-12  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * util/grub-md5-crypt.in: Prompt to retype a password, and check
+       if the passwords matches. Suggested by Matt Perry
+       <matt@primefactor.com>.
+       Also, don't use Perl any longer, because *BSD's sh and GNU
+       support ``read -r'', and GRUB doesn't support any other
+       operating system anyway.
+       
 2002-06-12  Yoshinori K. Okuji  <okuji@enbug.org>
 
        The terminal handling code is rewritten radically.
diff --git a/THANKS b/THANKS
index 99cfef0f3e56700b31741309088aa72a55b6175d..5e166f43bb08d33422108259c1127bc66a342e94 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -63,6 +63,7 @@ Kunihiro Ishiguro <kunihiro@zebra.org>
 Leendert Meyer <leen.meyer@home.nl>
 M. Meiarashi <mes@st.rim.or.jp>
 Mark Lundeberg <aa026@pgfn.bc.ca>
+Matt Perry <matt@primefactor.com>
 Matt Yourst <yourst@mit.edu>
 Matthias Granberry <matthias@slurpee.org>
 Matthias Kretschmer <m.kretschmer@bsdger.org>
index 54fb332c0c192f28e5af9454a5d1f5c9829f3291..c030c879305a06729ddacb07e7fee422a3c85179 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Encrypt a password in MD5 format
-#   Copyright (C) 2000 Free Software Foundation, Inc.
+#   Copyright (C) 2000,2002 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -66,19 +66,15 @@ stty -echo
 
 # Prompt to enter a password.
 echo -n "Password: "
+read -r password
+echo
 
-# read only one line... I don't know any really portable command for this.
-# Does anyone know? -okuji
-if test "x$BASH" = x; then
-    # FIXME: Use Perl instead at the moment.
-    password=`perl -e '$line = <>; print $line;'`
-else
-    # In BASH, use the builtin command ``read''.
-    read -r password
-fi
+# One more time.
+echo -n "Retype password: "
+read -r password2
+echo
 
 # Resume echo backs.
-echo
 stty echo
 
 if test "x$password" = x; then
@@ -86,6 +82,11 @@ if test "x$password" = x; then
     exit 1
 fi
 
+if test "x$password" != "x$password2"; then
+    echo "Sorry, passwords do not match."
+    exit 1
+fi
+
 # Run the grub shell.
 $grub_shell --batch --device-map=/dev/null <<EOF \
     | grep "^Encrypted: " | sed 's/^Encrypted: //'