2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Add a plugin interface to sudo main event loop.

This commit is contained in:
Todd C. Miller
2019-11-15 13:36:01 -07:00
parent 58cede6fee
commit 5793023ffd
17 changed files with 1114 additions and 199 deletions

View File

@@ -368,6 +368,15 @@ sudo_load_plugins(struct plugin_container *policy_plugin,
container->u.io->register_hooks(SUDO_HOOK_VERSION, register_hook);
}
}
/* Set event_alloc() in plugins. */
if (policy_plugin->u.policy->version >= SUDO_API_MKVERSION(1, 15))
policy_plugin->u.policy->event_alloc = sudo_plugin_event_alloc;
TAILQ_FOREACH(container, io_plugins, entries) {
if (container->u.io->version >= SUDO_API_MKVERSION(1, 15))
container->u.io->event_alloc = sudo_plugin_event_alloc;
}
sudo_debug_set_active_instance(sudo_debug_instance);
done: