From: Todd C. Miller Date: Tue, 27 Mar 2012 16:39:11 +0000 (-0400) Subject: If there is nothing to read from the askpass program, set errno to X-Git-Tag: SUDO_1_7_9p1~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50b3368c6dc6dcf4ae037280e39b02ffea2415db;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. --HG-- branch : 1.7 --- diff --git a/tgetpass.c b/tgetpass.c index b64bb8d3e..c1926a017 100644 --- a/tgetpass.c +++ b/tgetpass.c @@ -228,6 +228,9 @@ sudo_askpass(prompt) (void) close(pfd[0]); (void) sigaction(SIGPIPE, &saved_sa_pipe, NULL); + if (pass == NULL) + errno = EINTR; /* make cancel button simulate ^C */ + return pass; }