If there is nothing to read from the askpass program, set errno to

EINTR.  This makes the cancel button behave like the user entered
^C at the password prompt when PAM is used.
This commit is contained in:
Todd C. Miller
2012-03-27 12:41:28 -04:00
parent d35a8b4de4
commit 9be74cac45

View File

@@ -254,6 +254,9 @@ sudo_askpass(const char *askpass, const char *prompt)
(void) close(pfd[0]);
(void) sigaction(SIGPIPE, &saved_sa_pipe, NULL);
if (pass == NULL)
errno = EINTR; /* make cancel button simulate ^C */
debug_return_str_masked(pass);
}