From 97469c243c57d06f10ce72a38d212d4ea059f51a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 30 Jan 2015 13:07:21 -0700 Subject: [PATCH] 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. --- plugins/sudoers/sudoreplay.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/sudoers/sudoreplay.c b/plugins/sudoers/sudoreplay.c index f3ba0a83e..7f756d411 100644 --- a/plugins/sudoers/sudoreplay.c +++ b/plugins/sudoers/sudoreplay.c @@ -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")); }