diff options
author | Alexander Hall <halex@cvs.openbsd.org> | 2010-06-30 19:31:20 +0000 |
---|---|---|
committer | Alexander Hall <halex@cvs.openbsd.org> | 2010-06-30 19:31:20 +0000 |
commit | bc78374b30e3336ff169b894ad7b75694e7b3773 (patch) | |
tree | af781814c3f38ff046326e7909bc1697c1b8f8f2 /distrib/miniroot/install.sub | |
parent | f17407b7baba9198ecd8a467cbe39994d2955ad1 (diff) |
make the installer quit when ^D is pressed at any prompt
ok deraadt@
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r-- | distrib/miniroot/install.sub | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 405237084cd..dbf00ee7d50 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.607 2010/06/30 00:23:02 halex Exp $ +# $OpenBSD: install.sub,v 1.608 2010/06/30 19:31:19 halex 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 @@ -175,7 +175,7 @@ mount_mnt2() { askpass() { set -o noglob stty -echo - read -r resp?"$1 " + read -r resp?"$1 " || exit 1 stty echo set +o noglob echo @@ -227,16 +227,18 @@ retrap # and the function will return a non-zero value. Normally, the caller # will then reprint any prompt and call the function again. _ask() { - local _int _redo=0 _pid + local _int _redo=0 _pid _fail trap "_int=1" INT trap "_redo=1" TERM lock; dmesg >/tmp/update; unlock - read resp + read resp || _fail=1 lock; rm /tmp/update; unlock if (( _redo )); then stty raw stty -raw + elif [[ -n $_fail ]]; then + exit 1 else case $resp in !) echo "Type 'exit' to return to install." |