krb5_error_code
load_authdata_plugins(krb5_context context)
{
- struct errinfo err;
void **authdata_plugins_ftables = NULL;
struct krb5plugin_authdata_ftable_v0 *ftable = NULL;
size_t module_count;
int i, k;
init_proc server_init_proc = NULL;
- memset(&err, 0, sizeof(err));
-
/* Attempt to load all of the authdata plugins we can find. */
PLUGIN_DIR_INIT(&authdata_plugins);
if (PLUGIN_DIR_OPEN(&authdata_plugins) == 0) {
if (krb5int_open_plugin_dirs(objdirs, NULL,
- &authdata_plugins, &err) != 0) {
+ &authdata_plugins, &context->err) != 0) {
return KRB5_PLUGIN_NO_HANDLE;
}
}
n_authdata_systems = 0;
if (krb5int_get_plugin_dir_data(&authdata_plugins,
"authdata_server_0",
- &authdata_plugins_ftables, &err) != 0) {
+ &authdata_plugins_ftables, &context->err) != 0) {
return KRB5_PLUGIN_NO_HANDLE;
}
krb5_error_code
load_preauth_plugins(krb5_context context)
{
- struct errinfo err;
void **preauth_plugins_ftables;
struct krb5plugin_preauth_server_ftable_v1 *ftable;
int module_count, i, j, k;
preauth_server_init_proc server_init_proc = NULL;
char **kdc_realm_names = NULL;
- memset(&err, 0, sizeof(err));
-
/* Attempt to load all of the preauth plugins we can find. */
PLUGIN_DIR_INIT(&preauth_plugins);
if (PLUGIN_DIR_OPEN(&preauth_plugins) == 0) {
if (krb5int_open_plugin_dirs(objdirs, NULL,
- &preauth_plugins, &err) != 0) {
+ &preauth_plugins, &context->err) != 0) {
return KRB5_PLUGIN_NO_HANDLE;
}
}
preauth_plugins_ftables = NULL;
if (krb5int_get_plugin_dir_data(&preauth_plugins,
"preauthentication_server_1",
- &preauth_plugins_ftables, &err) != 0) {
+ &preauth_plugins_ftables, &context->err) != 0) {
return KRB5_PLUGIN_NO_HANDLE;
}
char *tmp_ktname = NULL, *tmp_ktpath;
krb5_data *realm = krb5_princ_realm(context, mname);
#ifndef LEAN_CLIENT
- krb5_keytab kt;
+ krb5_keytab kt = NULL;
krb5_keytab_entry new_entry;
#endif /* LEAN_CLIENT */
struct stat stb;
out:
if (tmp_ktname != NULL)
free(tmp_ktname);
+#ifndef LEAN_CLIENT
+ if (kt)
+ krb5_kt_close(context, kt);
+#endif
return retval;
}
krb5_kvno *kvno)
{
krb5_error_code retval = 0;
- krb5_keytab kt;
+ krb5_keytab kt = NULL;
krb5_keytab_entry kt_ent;
krb5_enctype enctype = IGNORE_ENCTYPE;
}
errout:
+ if (kt)
+ krb5_kt_close(context, kt);
+
return retval;
}
#endif /* LEAN_CLIENT */