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.
This commit is contained in:
Todd C. Miller
2016-10-17 09:02:34 -06:00
parent 9b886f6b2c
commit f632e0a63d

View File

@@ -197,17 +197,8 @@ restore:
/* Restore old tty settings. */ /* Restore old tty settings. */
if (!ISSET(flags, TGP_ECHO)) { if (!ISSET(flags, TGP_ECHO)) {
for (;;) {
/* Restore old tty settings if possible. */ /* Restore old tty settings if possible. */
if (sudo_term_restore(input, true) || errno != EINTR) (void) sudo_term_restore(input, true);
break;
/* Received SIGTTOU, suspend the process. */
signo[SIGTTOU] = 0;
if (suspend(SIGTTOU, callback) == -1) {
pass = NULL;
break;
}
}
} }
if (input != STDIN_FILENO) if (input != STDIN_FILENO)
(void) close(input); (void) close(input);