Initial cut at a hooks implementation. The plugin can register
hooks for getenv, putenv, setenv and unsetenv. This makes it possible for the plugin to trap changes to the environment made by authentication methods such as PAM or BSD auth so that such changes are reflected in the environment passed back to sudo for execve().
This commit is contained in:
@@ -155,6 +155,16 @@ sudo_load_plugins(struct plugin_container *policy_plugin,
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Install hooks (XXX - later). */
|
||||
if (policy_plugin->u.policy->version >= SUDO_API_MKVERSION(1, 2)) {
|
||||
if (policy_plugin->u.policy->register_hooks != NULL)
|
||||
policy_plugin->u.policy->register_hooks(SUDO_HOOK_VERSION, register_hook);
|
||||
tq_foreach_fwd(io_plugins, container) {
|
||||
if (container->u.io->register_hooks != NULL)
|
||||
container->u.io->register_hooks(SUDO_HOOK_VERSION, register_hook);
|
||||
}
|
||||
}
|
||||
|
||||
rval = true;
|
||||
|
||||
done:
|
||||
|
Reference in New Issue
Block a user