summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/password/share
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-09-20 23:44:13 +0000
committerdteske <dteske@FreeBSD.org>2012-09-20 23:44:13 +0000
commitf628c47944e7370c8d8c16cdcc6f98871a48be02 (patch)
tree6eb395555fa780676e51155e913c807210bdc403 /usr.sbin/bsdconfig/password/share
parent3a2b0e2811fa295dd198978ef2dcb53b37c2570d (diff)
downloadFreeBSD-src-f628c47944e7370c8d8c16cdcc6f98871a48be02.zip
FreeBSD-src-f628c47944e7370c8d8c16cdcc6f98871a48be02.tar.gz
Change all invocations of dialog(1) to no-longer require temporary files.
This allows bsdconfig to -- like bsdinstall -- operate from read-only media. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor)
Diffstat (limited to 'usr.sbin/bsdconfig/password/share')
-rw-r--r--usr.sbin/bsdconfig/password/share/password.subr13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/bsdconfig/password/share/password.subr b/usr.sbin/bsdconfig/password/share/password.subr
index 550d2aa..a0d1c50 100644
--- a/usr.sbin/bsdconfig/password/share/password.subr
+++ b/usr.sbin/bsdconfig/password/share/password.subr
@@ -68,7 +68,8 @@ f_dialog_input_password()
#
local retval _password1 _password2
while :; do
- eval $DIALOG \
+ local dialog_inputbox
+ dialog_inputbox=$( eval $DIALOG \
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
--hline \"\$hline\" \
@@ -76,15 +77,17 @@ f_dialog_input_password()
--cancel-label \"\$msg_cancel\" \
--insecure \
--passwordbox \"\$msg\" $size \
- 2> $DIALOG_TMPDIR/dialog.inputbox.$$
+ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
+ )
retval=$?
+ setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox"
_password1=$( f_dialog_inputstr )
# Return if user has either pressed ESC or chosen Cancel/No
[ $retval -eq $SUCCESS ] || return $retval
- eval $DIALOG \
+ dialog_inputbox=$( eval $DIALOG \
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
--hline \"\$hline\" \
@@ -92,9 +95,11 @@ f_dialog_input_password()
--cancel-label \"\$msg_cancel\" \
--insecure \
--passwordbox \"\$rmsg\" $rsize \
- 2> $DIALOG_TMPDIR/dialog.inputbox.$$
+ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
+ )
retval=$?
+ setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox"
_password2=$( f_dialog_inputstr )
# Return if user has either pressed ESC or chosen Cancel/No
OpenPOWER on IntegriCloud