For plugin events, set the sudo event base for setbase(NULL).
This makes it possible for a plugin to change the event base to a local one and then reset it back to its original value.
This commit is contained in:
@@ -1807,6 +1807,7 @@ plugin_event_loopbreak(struct sudo_plugin_event *pev)
|
||||
/*
|
||||
* Reset the event base of a struct sudo_plugin_event.
|
||||
* The event is removed from the old base (if any) first.
|
||||
* A NULL base can be used to set the default sudo event base.
|
||||
*/
|
||||
static void
|
||||
plugin_event_setbase(struct sudo_plugin_event *pev, void *base)
|
||||
@@ -1817,7 +1818,7 @@ plugin_event_setbase(struct sudo_plugin_event *pev, void *base)
|
||||
ev_int = __containerof(pev, struct sudo_plugin_event_int, public);
|
||||
if (ev_int->private.base != NULL)
|
||||
sudo_ev_del(ev_int->private.base, &ev_int->private);
|
||||
ev_int->private.base = base;
|
||||
ev_int->private.base = base ? base : sudo_event_base;
|
||||
debug_return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user