From 70b76e206e01600e157b38760807c77a9d65b779 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 14 Aug 2010 10:18:27 -0400 Subject: [PATCH] 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 --- auth/pam.c | 4 ++++ 1 file changed, 4 insertions(+) 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' || -- 2.40.0