In the plugin registers with the debug framework at open time, the

sudo front-end will now set the default debug instance appropriately
before calling into the plugin.  This means the plugin no longer needs
to do the sudo_debug_set_default_instance() dance.
This commit is contained in:
Todd C. Miller
2014-10-24 11:17:48 -06:00
parent a2e9d66be1
commit 4bf641df69
8 changed files with 103 additions and 83 deletions

View File

@@ -310,6 +310,10 @@ sudo_debug_register(const char *program, const char *const subsystems[],
SLIST_INSERT_HEAD(&instance->outputs, output, entries);
}
/* Set default instance if not already set. */
if (sudo_debug_default_instance == -1)
sudo_debug_default_instance = idx;
/* Stash the pid string so we only have to format it once. */
if (sudo_debug_pidlen == 0) {
(void)snprintf(sudo_debug_pidstr, sizeof(sudo_debug_pidstr), "[%d] ",