]> granicus.if.org Git - sudo/commitdiff
Avoid giving PAM a NULL password response, use the empty string instead.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 20 Jan 2002 19:21:33 +0000 (19:21 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 20 Jan 2002 19:21:33 +0000 (19:21 +0000)
This avoids a log warning when the user hits ^C at the password prompt
when PAM is in use.

auth/pam.c

index c375c83e4b937d9b8b7c00d8af0d1f64c1ed99bd..2960463c77276fcfffff07c3bd8db5c5194191d7 100644 (file)
@@ -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: