2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-28 21:07:55 +00:00

Avoid setting the tty to non-blocking mode so "sudoreplay | cat"

(for example) works as expected.  We only read a single byte from
the keyboard and only when interactive anyway so this should be fine.
This commit is contained in:
Todd C. Miller 2015-01-30 13:07:21 -07:00
parent 00e7dbd645
commit 97469c243c

View File

@ -411,9 +411,6 @@ replay_session(const double max_wait, const char *decimal)
/* Set stdin to raw mode if it is a tty */
interactive = isatty(STDIN_FILENO);
if (interactive) {
idx = fcntl(STDIN_FILENO, F_GETFL, 0);
if (idx != -1)
(void) fcntl(STDIN_FILENO, F_SETFL, idx | O_NONBLOCK);
if (!sudo_term_raw(STDIN_FILENO, 1))
sudo_fatal(U_("unable to set tty to raw mode"));
}