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.
This commit is contained in:
Todd C. Miller
2018-02-19 11:00:12 -07:00
parent 42fe0409f6
commit d5d170252a

View File

@@ -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);