summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-08-07 15:07:23 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-08-07 15:07:23 +0000
commit8de21f4876b60522cb7e919eb586d0685d620779 (patch)
tree373d74c08d3e08b9a904de4940c947e882fe29f5 /distrib/miniroot
parentc902b1048300930704ff7a56c9a2281ca7621bf0 (diff)
Check that timezones provided by the user do not include spaces.
e.g. 'Brazil/DeNoronha East'. Input with embedded spaces put the install script into a state where a valid timezone could not be entered. Problem noted by and fix tested by Javier Bassi. ok deraadt@
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sub10
1 files changed, 7 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 56d95cf7b86..5f210e4096e 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.650 2011/08/02 20:40:52 deraadt Exp $
+# $OpenBSD: install.sub,v 1.651 2011/08/07 15:07:22 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -1553,6 +1553,9 @@ set_timezone() {
"") continue ;;
"?") grep -v /. $_zonefile | showcols
continue ;;
+ *+([[:space:]])*)
+ echo "'$_zonepath' is not a valid timezone on this system."
+ continue ;;
esac
while isin $_zonepath/ $(cat $_zonefile); do
@@ -1562,6 +1565,8 @@ set_timezone() {
case $resp in
"") ;;
"?") sed -n "/^$_zsed/{s/$_zsed//;/\/./!p;}" $_zonefile | showcols ;;
+ *+([[:space:]])*)
+ echo "'$_zonepath/$resp' is not a valid timezone on this system." ;;
*) _zonepath=$_zonepath/$resp ;;
esac
done
@@ -1571,8 +1576,7 @@ set_timezone() {
return
fi
- echo -n "'${_zonepath}'"
- echo " is not a valid timezone on this system."
+ echo "'${_zonepath}' is not a valid timezone on this system."
done
}