From 7db9907f0372f45c890f03d26699796546217ab9 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Wed, 18 Feb 2009 00:03:07 +0000 Subject: Use 'read -r' to read password, which allows "\" to be in the password unless it's part of an escape sequence like "\r". Prompted by Aaron W. Hsu via PR#6042. ok deraadt@ --- distrib/miniroot/install.sub | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index c7290ff034d..28a795506ad 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.444 2009/02/14 04:00:07 krw Exp $ +# $OpenBSD: install.sub,v 1.445 2009/02/18 00:03:06 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 @@ -247,10 +247,13 @@ stdsize () { # Display $1 as the prompt. # *Don't* allow the '!' options that ask does. # *Don't* echo input. +# *Don't* interpret "\" as escape character if not at start of escape +# sequence. e.g. "\s" will be left alone and "\" will +# not cause line continuation. "\r", etc. still get interpreted. askpass() { set -o noglob stty -echo - read resp?"$1 " + read -r resp?"$1 " stty echo set +o noglob echo -- cgit v1.2.3