From f632e0a63dd6880fc5646e0058dc0295f032591d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 17 Oct 2016 09:02:34 -0600 Subject: [PATCH] Don't generate SIGTOU when restoring the terminal modes. It doen't make sense to suspend the process only to restore the terminal settings since in this case the shell has already taken ownership of the tty. --- src/tgetpass.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/tgetpass.c b/src/tgetpass.c index 4537b1c3e..c84f5de12 100644 --- a/src/tgetpass.c +++ b/src/tgetpass.c @@ -197,17 +197,8 @@ restore: /* Restore old tty settings. */ if (!ISSET(flags, TGP_ECHO)) { - for (;;) { - /* Restore old tty settings if possible. */ - if (sudo_term_restore(input, true) || errno != EINTR) - break; - /* Received SIGTTOU, suspend the process. */ - signo[SIGTTOU] = 0; - if (suspend(SIGTTOU, callback) == -1) { - pass = NULL; - break; - } - } + /* Restore old tty settings if possible. */ + (void) sudo_term_restore(input, true); } if (input != STDIN_FILENO) (void) close(input); -- 2.40.0