summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-02-19 02:11:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-02-19 02:11:33 +0000
commita0f90e4f02db4a5b73255b5487ffe2eca75ebfce (patch)
treee1783e67e98d066135d5747aa994c8afdaf36c7c /distrib/miniroot
parent533b4185b646188efb76c910f33ff7778e89ae23 (diff)
Third time lucky. Proper use of quotes when comparing the first and
second copies of the entered password will preserve leading and trailing spaces. Prodded by dale@. Proper clue pointed out by todd@.
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sh6
-rw-r--r--distrib/miniroot/install.sub3
2 files changed, 5 insertions, 4 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index edf4ee381ee..516d680f4b5 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sh,v 1.160 2009/02/15 15:56:45 krw Exp $
+# $OpenBSD: install.sh,v 1.161 2009/02/19 02:11:32 krw Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2004 Todd Miller, Theo de Raadt, Ken Westerback
@@ -334,7 +334,9 @@ while :; do
_password=$resp
askpass "Password for root account? (again)"
- [[ $resp == $_password ]] && break
+ # N.B.: Need quotes around $resp and $_password to preserve leading
+ # or trailing spaces.
+ [[ "$resp" == "$_password" ]] && break
echo "Passwords do not match, try again."
done
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 6c94764c829..32ac77b541f 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.446 2009/02/19 01:25:22 krw Exp $
+# $OpenBSD: install.sub,v 1.447 2009/02/19 02:11:32 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2007 Todd Miller, Theo de Raadt, Ken Westerback
@@ -248,7 +248,6 @@ stdsize () {
# *Don't* allow the '!' options that ask does.
# *Don't* echo input.
# *Don't* interpret "\" as escape character.
-# NOTE: leading and trailing space will be trimmed from password.
askpass() {
set -o noglob
stty -echo