From: Todd C. Miller Date: Tue, 27 Mar 2012 16:41:28 +0000 (-0400) Subject: If there is nothing to read from the askpass program, set errno to X-Git-Tag: SUDO_1_8_5~1^2~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9be74cac45fa878c7797ea301c6279f8273ea1ec;p=sudo 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. --- diff --git a/src/tgetpass.c b/src/tgetpass.c index c19e83b9c..8b12bdc8e 100644 --- a/src/tgetpass.c +++ b/src/tgetpass.c @@ -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); }