Lines Matching +full:touch +full:- +full:enter
3 # Copyright (c) 2006-2013 Devin Teske
43 # Number of tries a user gets to enter his/her password before we log the
50 # non-NULL to enable authentication as `root', otherwise disabled.
61 # requested authentication user does not exist? Set to non-NULL to enable,
62 # otherwise a non-existent user is treated like an invalid password.
71 # Re-execution of the current program via sudo is automatically handled.
75 # USE_XDIALOG Either NULL or Non-NULL. If given a value will indicate
83 [ "$( id -u )" = "0" ] && return $SUCCESS
89 # the option to save this preference (by touch(1)ing a file in the
93 if [ ! -e "$checkpath" ]; then
100 " # END-QUOTE
112 --title \"\$DIALOG_TITLE\" \
113 --backtitle \"\$DIALOG_BACKTITLE\" \
114 --hline \"\$hline\" \
115 --ok-label \"\$msg_ok\" \
116 --cancel-label \"\$msg_cancel\" \
117 --menu \"\$prompt\" \
128 f_eval_catch $funcname touch \
129 'touch "%s"' "$checkpath" &&
134 # This user has created the path signing-off on sudo(8)-use
144 :| sudo -S -v 2> /dev/null
145 if [ $? -ne $SUCCESS ]; then
162 while [ $nfailures -lt $PASSWD_TRIES ]; do
165 --title "$DIALOG_TITLE" \
166 --backtitle "$DIALOG_BACKTITLE" \
167 --hline "$hline" \
168 --ok-label "$msg_ok" \
169 --cancel-label "$msg_cancel" \
170 --password --inputbox "$prompt" \
176 # Catch X11-related errors
177 if [ $retval -eq $DIALOG_ESC ]; then
179 elif [ $retval -ne $DIALOG_OK ]; then
185 --title "$DIALOG_TITLE" \
186 --backtitle "$DIALOG_BACKTITLE" \
187 --hline "$hline" \
188 --ok-label "$msg_ok" \
189 --cancel-label "$msg_cancel" \
190 --insecure \
191 --passwordbox "$prompt" \
201 sudo -S -v 2> /dev/null <<-EOF
206 if [ $retval -eq $SUCCESS ]; then
214 if [ $nfailures -lt $PASSWD_TRIES ]; then
225 if [ $nfailures -ge $PASSWD_TRIES ]; then
227 logger -p auth.notice -t sudo " " \
238 if [ "$USE_XDIALOG" -a "$SSH_CONNECTION" -a "$DISPLAY" ]; then
244 xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \
245 $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \
246 ~root/.Xauthority merge - > /dev/null 2>&1'
249 # Re-execute ourselves with sudo(8)
251 if [ $ARGC -gt 0 ]; then
262 # Prompts the user to enter a username and password to be authenticated via
267 # USE_XDIALOG Either NULL or Non-NULL. If given a value will indicate
277 # Secure-mode has been requested.
281 [ "$(id -u)" = "0" ] || f_die 1 "$msg_secure_mode_requires_root"
295 height=$(( $height + 2 )) # Add height for --password
302 while [ $nfailures -lt $PASSWD_TRIES ]; do
304 --title "$DIALOG_TITLE" \
305 --backtitle "$DIALOG_BACKTITLE" \
306 --hline "$hline" \
307 --ok-label "$msg_ok" \
308 --cancel-label "$msg_cancel" \
309 --password --2inputsbox "$msg" \
316 # Catch X11-related errors
317 [ $retval -eq $DIALOG_ESC ] && f_die $retval "$user_pass"
320 [ $retval -eq $DIALOG_OK ] || exit $retval
323 # Make sure the user exists and is non-root
346 elif [ $nfailures -lt $PASSWD_TRIES ]; then
356 su -m "$user" <<-EOF
358 sudo -k
359 sudo -S -v 2> /dev/null <<EOP
368 if [ $retval -eq $SUCCESS ]; then
376 if [ $nfailures -lt $PASSWD_TRIES ]; then
387 if [ $nfailures -ge $PASSWD_TRIES ]; then
389 logger -p auth.notice -t sudo " " \
390 "${SUDO_USER:-$USER} : $msg" \
401 # If not already root, make the switch to root by re-executing ourselves via
402 # sudo(8) using user-supplied credentials.
406 # SECURE Either NULL or Non-NULL. If given a value will indicate
412 if [ "$(id -u)" != "0" -a ! "$SECURE" ]; then