1if [ ! "$_MUSTBEROOT_SUBR" ]; then _MUSTBEROOT_SUBR=1 2# 3# Copyright (c) 2006-2012 Devin Teske 4# All Rights Reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: --- 10 unchanged lines hidden (view full) --- 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# |
27# $FreeBSD: head/usr.sbin/bsdconfig/share/mustberoot.subr 240768 2012-09-20 23:44:13Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_include $BSDCFG_SHARE/dialog.subr 34 35BSDCFG_LIBE="/usr/libexec/bsdconfig" --- 78 unchanged lines hidden (view full) --- 114 --password --inputbox "$msg" $size \ 115 2>&1 > /dev/null ) 116 retval=$? 117 118 # Catch X11-related errors 119 [ $retval -eq 255 ] && 120 f_die $retval "$password" 121 else |
122 local dialog_inputbox 123 dialog_inputbox=$( $DIALOG \ |
124 --title "$DIALOG_TITLE" \ 125 --backtitle "$DIALOG_BACKTITLE" \ 126 --hline "$hline" \ 127 --ok-label "$msg_ok" \ 128 --cancel-label "$msg_cancel" \ 129 --insecure \ 130 --passwordbox "$msg" $size \ |
131 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 132 ) |
133 retval=$? |
134 setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" |
135 password=$( f_dialog_inputstr ) 136 fi 137 138 # Exit if the user cancelled. 139 [ $retval -eq $SUCCESS ] || exit $retval 140 141 # 142 # Validate sudo(8) credentials --- 223 unchanged lines hidden --- |