From: Todd C. Miller Date: Sun, 20 Jan 2002 19:21:33 +0000 (+0000) Subject: Avoid giving PAM a NULL password response, use the empty string instead. X-Git-Tag: SUDO_1_6_6~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73979f1a24ada5a988803615d74e802963b92d51;p=sudo Avoid giving PAM a NULL password response, use the empty string instead. This avoids a log warning when the user hits ^C at the password prompt when PAM is in use. --- diff --git a/auth/pam.c b/auth/pam.c index c375c83e4..2960463c7 100644 --- a/auth/pam.c +++ b/auth/pam.c @@ -221,7 +221,9 @@ sudo_conv(num_msg, msg, response, appdata_ptr) /* Read the password. */ pr->resp = estrdup((char *) tgetpass(p, def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags)); - if (pr->resp == NULL || *pr->resp == '\0') + if (pr->resp == NULL) + pr->resp = ""; + if (*pr->resp == '\0') nil_pw = 1; /* empty password */ break; case PAM_TEXT_INFO: