From 8d97a8d20f9638cf61cfd525c12215d83beb93e9 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 29 Sep 2006 14:53:42 +0000 Subject: [PATCH] If the user enters ^C at the password prompt, abort instead of trying to authenticate with an empty password (which causes an annoying delay). --- auth/pam.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/auth/pam.c b/auth/pam.c index bace4891a..f97341af2 100644 --- a/auth/pam.c +++ b/auth/pam.c @@ -249,7 +249,12 @@ sudo_conv(num_msg, msg, response, appdata_ptr) p = pm->msg; /* Read the password. */ pass = tgetpass(p, def_passwd_timeout * 60, flags); - pr->resp = estrdup(pass ? pass : ""); + if (pass == NULL) { + /* We got ^C instead of a password; abort quickly. */ + nil_pw = 1; + return(PAM_CONV_ERR); + } + pr->resp = estrdup(pass); if (*pr->resp == '\0') nil_pw = 1; /* empty password */ else -- 2.50.1