Add the ability to set a default event base, to be used by plugins

which don't have access to the event base.
This commit is contained in:
Todd C. Miller
2017-07-13 13:59:31 -06:00
parent 9a76678317
commit d2a0bfbb12
6 changed files with 40 additions and 4 deletions

View File

@@ -302,6 +302,9 @@ fill_exec_closure_nopty(struct exec_closure_nopty *ec,
sudo_fatal(U_("unable to add event to queue"));
#endif
/* Set the default event base. */
sudo_ev_base_setdef(ec->evbase);
debug_return;
}
@@ -313,6 +316,7 @@ free_exec_closure_nopty(struct exec_closure_nopty *ec)
{
debug_decl(free_exec_closure_nopty, SUDO_DEBUG_EXEC)
sudo_ev_base_setdef(NULL);
sudo_ev_base_free(ec->evbase);
sudo_ev_free(ec->errpipe_event);
sudo_ev_free(ec->sigint_event);