summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2001-11-25 19:40:52 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2001-11-25 19:40:52 +0000
commita3b048ba319bbdc2f0175b8c27b96d668ae3842a (patch)
treeaeadcff3c4af3b14d1c9a32fca5e041ea92cc3ea
parent84bf2b9f075e0779a3888537dcce22c6256a7982 (diff)
Add capability to accept & correctly process a root password with
trailing spaces during install. Do not make the previously entered first password value the default value if passwords do not match the first time. Update Copyright (ok deraadt@).
-rw-r--r--distrib/miniroot/install.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 7e7323b8e70..74c805ed59e 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,8 +1,8 @@
#!/bin/sh
-# $OpenBSD: install.sh,v 1.80 2001/11/18 22:48:58 krw Exp $
+# $OpenBSD: install.sh,v 1.81 2001/11/25 19:40:51 krw Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
-# Copyright (c) 1997,1998 Todd Miller, Theo de Raadt
+# Copyright (c) 1997-2001 Todd Miller, Theo de Raadt, Ken Westerback
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -343,11 +343,13 @@ done
echo
echo 'Please enter the initial password that the root account will have.'
+_oifs="$IFS"
+IFS=
resp=
while [ "X${resp}" = X"" ]; do
echo -n "Password (will not echo): "
stty -echo
- getresp -n "${_password}"
+ getresp -n ""
stty echo
echo
_password="$resp"
@@ -362,6 +364,7 @@ while [ "X${resp}" = X"" ]; do
resp=
fi
done
+IFS="$_oifs"
md_questions
@@ -412,7 +415,7 @@ cd /
remount_fs /tmp/fstab.shadow
md_installboot ${ROOTDISK}
-_encr=`echo "${_password}" | /mnt/usr/bin/encrypt -b 7`
+_encr=`/mnt/usr/bin/encrypt -b 7 "${_password}"`
echo "1,s@^root::@root:${_encr}:@
w
q" | ed /mnt/etc/master.passwd 2> /dev/null