Re-enable cleanup functions in sudoers plugin and sudo driver

for error()/errorx().
This commit is contained in:
Todd C. Miller
2010-05-28 12:15:14 -04:00
parent 34e1a06767
commit d2d68aa24d
3 changed files with 10 additions and 29 deletions

View File

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

View File

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

View File

@@ -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.