Fix event loop called via I/O log close function.

We need to set events that were pending in the old base in the new one.
Fixes sending the final I/O log data and the ExitMessage to the server.
This commit is contained in:
Todd C. Miller
2019-12-07 08:42:12 -07:00
parent d0b80b404c
commit 9d737441f4
3 changed files with 46 additions and 26 deletions

View File

@@ -727,18 +727,7 @@ sudoers_io_close(int exit_status, int error)
debug_decl(sudoers_io_close, SUDOERS_DEBUG_PLUGIN)
if (iolog_remote) {
if (client_closure.disabled)
goto done;
if (!fmt_exit_message(&client_closure, exit_status, error))
goto done;
/*
* Main sudo event loop exited, use our own mini event loop
* to flush the write queue and read the final commit messages.
*/
if (!client_loop(&client_closure))
goto done;
client_close(&client_closure, exit_status, error);
} else {
for (i = 0; i < IOFD_MAX; i++) {
if (iolog_files[i].fd.v == NULL)
@@ -747,8 +736,6 @@ sudoers_io_close(int exit_status, int error)
}
}
done:
client_closure_free(&client_closure);
sudo_freepwcache();
sudo_freegrcache();