From: Todd C. Miller Date: Sat, 14 Aug 2010 14:18:27 +0000 (-0400) Subject: If the user hits ^C while a password is being read, error out before X-Git-Tag: SUDO_1_7_5~193 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70b76e206e01600e157b38760807c77a9d65b779;p=sudo If the user hits ^C while a password is being read, error out before reading any further passwords in the pam conversation function. Otherwise, if multiple PAM auth methods are required, the user will have to hit ^C for each one. --HG-- branch : 1.7 --- diff --git a/auth/pam.c b/auth/pam.c index ddffe01d9..ca2ef1069 100644 --- a/auth/pam.c +++ b/auth/pam.c @@ -281,6 +281,10 @@ sudo_conv(num_msg, msg, response, appdata_ptr) case PAM_PROMPT_ECHO_OFF: prompt = def_prompt; + /* Error out if the last password read was interrupted. */ + if (gotintr) + goto err; + /* Is the sudo prompt standard? (If so, we'l just use PAM's) */ std_prompt = strncmp(def_prompt, "Password:", 9) == 0 && (def_prompt[9] == '\0' ||