]> granicus.if.org Git - sudo/commitdiff
Avoid setting the tty to non-blocking mode so "sudoreplay | cat"
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 30 Jan 2015 20:07:21 +0000 (13:07 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 30 Jan 2015 20:07:21 +0000 (13:07 -0700)
(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

index f3ba0a83e56bab44e0c7db353536f3c41721f739..7f756d41123da7309f0cd13054427d1d916a28fa 100644 (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"));
     }