]> granicus.if.org Git - sudo/commitdiff
If there is nothing to read from the askpass program, set errno to
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 27 Mar 2012 16:39:11 +0000 (12:39 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 27 Mar 2012 16:39:11 +0000 (12:39 -0400)
EINTR.  This makes the cancel button behave like the user entered
^C at the password prompt when PAM is used.

--HG--
branch : 1.7

tgetpass.c

index b64bb8d3e51e5ca3c8379f4ecbba7f68aac00b37..c1926a01769a982bc8e74dc946281182b99213b2 100644 (file)
@@ -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;
 }