From: Todd C. Miller Date: Mon, 17 Oct 2016 15:02:34 +0000 (-0600) Subject: Don't generate SIGTOU when restoring the terminal modes. It doen't X-Git-Tag: SUDO_1_8_19^2~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f632e0a63dd6880fc5646e0058dc0295f032591d;p=sudo 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. --- 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);