return 0;
}
-static void
-get_errmsg(krb5_context kcontext, krb5_error_code err_code)
-{
- kdb_vftabl *v;
- const char *e;
-
- if (err_code == 0)
- return;
- assert(kcontext != NULL && kcontext->dal_handle != NULL);
- v = &kcontext->dal_handle->lib_handle->vftabl;
- if (v->errcode_2_string == NULL)
- return;
- e = v->errcode_2_string(kcontext, err_code);
- assert (e != NULL);
- krb5_set_error_message(kcontext, err_code, "%s", e);
- if (v->release_errcode_string)
- v->release_errcode_string(kcontext, e);
-}
-
static krb5_error_code
get_vftabl(krb5_context kcontext, kdb_vftabl **vftabl_ptr)
{
goto clean_n_exit;
assert(v->init_module != NULL);
status = v->init_module(kcontext, section, db_args, mode);
- get_errmsg(kcontext, status);
clean_n_exit:
if (section)
goto clean_n_exit;
}
status = v->db_create(kcontext, section, db_args);
- get_errmsg(kcontext, status);
clean_n_exit:
if (section)
v = &kcontext->dal_handle->lib_handle->vftabl;
assert(v->fini_module != NULL);
status = v->fini_module(kcontext);
- get_errmsg(kcontext, status);
if (status)
return status;
goto clean_n_exit;
}
status = v->db_destroy(kcontext, section, db_args);
- get_errmsg(kcontext, status);
clean_n_exit:
if (section)
return status;
if (v->db_get_age == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_get_age(kcontext, db_name, t);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_get_age(kcontext, db_name, t);
}
krb5_error_code
return status;
if (v->db_lock == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_lock(kcontext, lock_mode);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_lock(kcontext, lock_mode);
}
krb5_error_code
return status;
if (v->db_unlock == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_unlock(kcontext);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_unlock(kcontext);
}
krb5_error_code
return status;
if (v->db_get_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_get_principal(kcontext, search_for, 0, entries, nentries,
- more);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_get_principal(kcontext, search_for, 0, entries, nentries,
+ more);
}
krb5_error_code
return status;
if (v->db_get_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_get_principal(kcontext, search_for,
- flags, entries, nentries, more);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_get_principal(kcontext, search_for, flags, entries, nentries,
+ more);
}
krb5_error_code
return status;
if (v->db_free_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_free_principal(kcontext, entry, count);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_free_principal(kcontext, entry, count);
}
static void
if (status)
return status;
status = v->db_put_principal(kcontext, entries, nentries, db_args);
- get_errmsg(kcontext, status);
free_db_args(kcontext, db_args);
return status;
}
}
status = v->db_put_principal(kcontext, entries, nentries, db_args);
- get_errmsg(kcontext, status);
if (status == 0 && fupd) {
upd = fupd;
for (i = 0; i < *nentries; i++) {
return status;
if (v->db_delete_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_delete_principal(kcontext, search_for, nentries);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_delete_principal(kcontext, search_for, nentries);
}
krb5_error_code
return KRB5_KDB_DBTYPE_NOSUP;
status = v->db_delete_principal(kcontext, search_for, nentries);
- get_errmsg(kcontext, status);
/*
* We need to commit our update upon success
return status;
if (v->db_iterate == NULL)
return 0;
- status = v->db_iterate(kcontext, match_entry, func, func_arg);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_iterate(kcontext, match_entry, func, func_arg);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- status = v->set_master_key(kcontext, pwd, key);
- get_errmsg(kcontext, status);
- return status;
+ return v->set_master_key(kcontext, pwd, key);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- status = v->set_master_key_list(kcontext, keylist);
- get_errmsg(kcontext, status);
- return status;
+ return v->set_master_key_list(kcontext, keylist);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- status = v->get_master_key(kcontext, key);
- get_errmsg(kcontext, status);
- return status;
+ return v->get_master_key(kcontext, key);
}
krb5_error_code
return status;
if (v->get_master_key_list == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->get_master_key_list(kcontext, keylist);
- get_errmsg(kcontext, status);
- return status;
+ return v->get_master_key_list(kcontext, keylist);
}
krb5_error_code
status = get_vftabl(context, &v);
if (status)
return status;
- status = v->fetch_master_key_list(context, mname, mkey, mkvno, mkey_list);
- get_errmsg(context, status);
- return status;
+ return v->fetch_master_key_list(context, mname, mkey, mkvno, mkey_list);
}
krb5_error_code
return status;
if (v->store_master_key == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->store_master_key(kcontext, keyfile, mname, kvno, key,
- master_pwd);
- get_errmsg(kcontext, status);
- return status;
+ return v->store_master_key(kcontext, keyfile, mname, kvno, key,
+ master_pwd);
}
krb5_error_code
return status;
if (v->store_master_key_list == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->store_master_key_list(kcontext, keyfile, mname, keylist,
- master_pwd);
- get_errmsg(kcontext, status);
- return status;
+ return v->store_master_key_list(kcontext, keyfile, mname, keylist,
+ master_pwd);
}
char *krb5_mkey_pwd_prompt1 = KRB5_KDC_MKEY_1;
v = &context->dal_handle->lib_handle->vftabl;
retval = v->fetch_master_key(context, mname, &tmp_key, kvno, db_args);
- get_errmsg(context, retval);
if (retval)
goto clean_n_exit;
return status;
if (v->verify_master_key == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->verify_master_key(kcontext, mprinc, kvno, mkey);
- get_errmsg(kcontext, status);
- return status;
+ return v->verify_master_key(kcontext, mprinc, kvno, mkey);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- status = v->dbe_search_enctype(kcontext, dbentp, start, ktype, stype,
- kvno, kdatap);
- get_errmsg(kcontext, status);
- return status;
+ return v->dbe_search_enctype(kcontext, dbentp, start, ktype, stype, kvno,
+ kdatap);
}
#define REALM_SEP_STRING "@"
status = get_vftabl(kcontext, &v);
if (status)
return status;
- status = v->db_change_pwd(kcontext, master_key, ks_tuple, ks_tuple_count,
- passwd, new_kvno, keepold, db_entry);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_change_pwd(kcontext, master_key, ks_tuple, ks_tuple_count,
+ passwd, new_kvno, keepold, db_entry);
}
/* policy management functions */
return status;
if (v->db_create_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_create_policy(kcontext, policy);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_create_policy(kcontext, policy);
}
krb5_error_code
return status;
if (v->db_get_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_get_policy(kcontext, name, policy, cnt);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_get_policy(kcontext, name, policy, cnt);
}
krb5_error_code
return status;
if (v->db_put_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_put_policy(kcontext, policy);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_put_policy(kcontext, policy);
}
krb5_error_code
return status;
if (v->db_iter_policy == NULL)
return 0;
- status = v->db_iter_policy(kcontext, match_entry, func, data);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_iter_policy(kcontext, match_entry, func, data);
}
krb5_error_code
return status;
if (v->db_delete_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_delete_policy(kcontext, policy);
- get_errmsg(kcontext, status);
- return status;
+ return v->db_delete_policy(kcontext, policy);
}
void
if (status || v->db_free_policy == NULL)
return;
v->db_free_policy(kcontext, policy);
- get_errmsg(kcontext, status);
}
krb5_error_code
if (status)
goto clean_n_exit;
status = v->promote_db(kcontext, section, db_args);
- get_errmsg(kcontext, status);
clean_n_exit:
free(section);