From: Todd C. Miller Date: Fri, 28 May 2010 16:15:14 +0000 (-0400) Subject: Re-enable cleanup functions in sudoers plugin and sudo driver X-Git-Tag: SUDO_1_8_0~563 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2d68aa24d1e65cc500b19a4c3d8c2249c12f01f;p=sudo Re-enable cleanup functions in sudoers plugin and sudo driver for error()/errorx(). --- diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 1c5fd9eee..da7d15f1f 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -1144,11 +1144,6 @@ cleanup(int gotsignal) sudo_endpwent(); sudo_endgrent(); } -#ifdef notyet - /* XXX */ - if (def_transcript) - term_restore(STDIN_FILENO, 0); -#endif } static int diff --git a/src/exec.c b/src/exec.c index 7771a2217..ccea358fe 100644 --- a/src/exec.c +++ b/src/exec.c @@ -149,6 +149,16 @@ pty_setup(uid_t uid) } } +/* + * Cleanup hook for error()/errorx() + */ +void +cleanup(int gotsignal) +{ + if (!tq_empty(&io_plugins)) + term_restore(io_fds[SFD_USERTTY], 0); +} + /* Call I/O plugin tty input log method. */ static int log_ttyin(char *buf, unsigned int n) diff --git a/src/sudo.c b/src/sudo.c index fa7bed999..13df14117 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -625,30 +625,6 @@ disable_coredumps(void) #endif /* RLIMIT_CORE && !SUDO_DEVEL */ } -/* - * Cleanup hook for error()/errorx() - */ -void -cleanup(int gotsignal) -{ -#if 0 /* XXX */ - struct sudo_nss *nss; - - if (!gotsignal) { - if (snl != NULL) { - tq_foreach_fwd(snl, nss) - nss->close(nss); - } - sudo_endpwent(); - sudo_endgrent(); - } -#ifdef _PATH_SUDO_TRANSCRIPT - if (def_transcript) - term_restore(STDIN_FILENO, 0); -#endif -#endif -} - /* * Setup the execution environment immediately prior to the call to execve() * Returns TRUE on success and FALSE on failure.