If the user enters ^C at the password prompt, abort instead of
trying to authenticate with an empty password (which causes an annoying delay).
This commit is contained in:
@@ -249,7 +249,12 @@ sudo_conv(num_msg, msg, response, appdata_ptr)
|
|||||||
p = pm->msg;
|
p = pm->msg;
|
||||||
/* Read the password. */
|
/* Read the password. */
|
||||||
pass = tgetpass(p, def_passwd_timeout * 60, flags);
|
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')
|
if (*pr->resp == '\0')
|
||||||
nil_pw = 1; /* empty password */
|
nil_pw = 1; /* empty password */
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user