Skip to content

Commit

Permalink
lib/krb5: common plugin only fallback if load_fn() fails
Browse files Browse the repository at this point in the history
Only fallback to loading the plugin function table directly if
if the initialization function is not exported.  Failing a
consistency check should not permit falling back to a potentially
incompatible function table.

Change-Id: Ic753ed9a090aef6073853f7309f0f8f0f29d0aa9
  • Loading branch information
jaltman committed Feb 21, 2019
1 parent 060e7dd commit a47316a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/krb5/plugin.c
Expand Up @@ -597,7 +597,10 @@ add_dso_plugins_load_fn(krb5_context context,
ret = load_fn(context, &get_instance, &n_ftables, &ftables);
if (ret) {
krb5_warn(context, ret, "plugin %s failed to load", dsopath);
return NULL;

/* fallback to loading structure directly */
return add_dso_plugin_struct(context, dsopath,
dsohandle, caller->name);
}

if (!validate_plugin_deps(context, caller, dsopath, get_instance))
Expand Down Expand Up @@ -651,11 +654,6 @@ search_modules(heim_object_t key, heim_object_t value, void *ctx)
s->caller,
path,
p->dsohandle);
if (plugins == NULL) {
/* fallback to loading structure directly */
plugins = add_dso_plugin_struct(s->context, path,
p->dsohandle, s->caller->name);
}
if (plugins) {
heim_dict_set_value(p->plugins_by_name, s->n, plugins);
_krb5_debug(s->context, 5, "Loaded %zu %s %s plugin%s from %s",
Expand Down

0 comments on commit a47316a

Please sign in to comment.