krb5, kadm5: refactor plugin API
Refactor plugin framework to use a single list of loaded plugins; add a new plugin API where DSOs export a load function that can declare dependencies and export multiple plugins; refactor kadm5 hook API to use krb5 plugin framework. More information in krb5-plugin(7).
This commit is contained in:

committed by
Nico Williams

parent
e9b3b2326d
commit
803efebca5
@@ -58,13 +58,24 @@ cc_plugin_register_to_context(krb5_context context, const void *plug, void *plug
|
||||
return KRB5_PLUGIN_NO_HANDLE;
|
||||
}
|
||||
|
||||
static const char *ccache_plugin_deps[] = { "krb5", NULL };
|
||||
|
||||
static struct krb5_plugin_data
|
||||
ccache_plugin_data = {
|
||||
"krb5",
|
||||
KRB5_PLUGIN_CCACHE,
|
||||
0,
|
||||
ccache_plugin_deps,
|
||||
krb5_get_instance
|
||||
};
|
||||
|
||||
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
|
||||
_krb5_load_ccache_plugins(krb5_context context)
|
||||
{
|
||||
krb5_error_code userctx = 0;
|
||||
|
||||
(void)_krb5_plugin_run_f(context, "krb5", KRB5_PLUGIN_CCACHE,
|
||||
0, 0, &userctx, cc_plugin_register_to_context);
|
||||
(void)_krb5_plugin_run_f(context, &ccache_plugin_data, 0,
|
||||
&userctx, cc_plugin_register_to_context);
|
||||
|
||||
return userctx;
|
||||
}
|
||||
|
Reference in New Issue
Block a user