From: Todd C. Miller <Todd.Miller@sudo.ws>
Date: Mon, 19 Feb 2018 18:00:12 +0000 (-0700)
Subject: In pty_cleanup() we need to call sudo_term_restore() even if no I/O
X-Git-Tag: SUDO_1_8_23^2~131
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5d170252a1065a6b10c3e8d0a7df1aee13a33df;p=sudo

In pty_cleanup() we need to call sudo_term_restore() even if no I/O
plugins are present as long as /dev/tty exists.  Fixes the use_pty
case with no I/O plugins.
---

diff --git a/src/exec_pty.c b/src/exec_pty.c
index ce7ca3b09..710877395 100644
--- a/src/exec_pty.c
+++ b/src/exec_pty.c
@@ -120,7 +120,7 @@ pty_cleanup(void)
 {
     debug_decl(cleanup, SUDO_DEBUG_EXEC);
 
-    if (!TAILQ_EMPTY(&io_plugins) && io_fds[SFD_USERTTY] != -1)
+    if (io_fds[SFD_USERTTY] != -1)
 	sudo_term_restore(io_fds[SFD_USERTTY], false);
     if (utmp_user != NULL)
 	utmp_logout(slavename, 0);