]> granicus.if.org Git - sudo/commitdiff
If the user hits ^C while a password is being read, error out before
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 14 Aug 2010 14:18:27 +0000 (10:18 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 14 Aug 2010 14:18:27 +0000 (10:18 -0400)
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

auth/pam.c

index ddffe01d971b4987cace5c2f9a1d8b4953ca1d7f..ca2ef10695754e0c49c4610ed2f67567b6b92e0e 100644 (file)
@@ -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' ||