]> 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:49 +0000 (10:18 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 14 Aug 2010 14:18:49 +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.

plugins/sudoers/auth/pam.c

index decc5617f3629c6cdd393e328f9fe9c6707d2c9f..53cf6349c9647c8cf0f4437686b08ac2789b0074 100644 (file)
@@ -283,6 +283,10 @@ converse(int num_msg, PAM_CONST struct pam_message **msg,
            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' ||