Wrap calls to plugin event callbacks to use the plugin's debug instance.

Otherwise, the debug output in a plugin's event callback will go
to the sudo debug file, not sudoers.
This commit is contained in:
Todd C. Miller
2020-01-15 14:05:08 -07:00
parent 41242e121f
commit 405d26f5b8
2 changed files with 30 additions and 2 deletions

View File

@@ -109,7 +109,10 @@ TAILQ_HEAD(plugin_container_list, plugin_container);
*/
struct sudo_plugin_event_int {
struct sudo_event private; /* must be first */
struct sudo_plugin_event public;
int debug_instance; /* plugin's debug instance */
void *closure; /* actual user closure */
sudo_ev_callback_t callback; /* actual user callback */
struct sudo_plugin_event public; /* user-visible portion */
};
extern struct plugin_container policy_plugin;