* init_module. This function may return an error if the database already
* exists. Used by kdb5_util create.
*/
- krb5_error_code (*db_create)(krb5_context kcontext, char *conf_section,
- char **db_args);
+ krb5_error_code (*create)(krb5_context kcontext, char *conf_section,
+ char **db_args);
/*
* Optional: Destroy a database. conf_section and db_args have the same
* usage, the database is destroyed while open, so the module should handle
* that.
*/
- krb5_error_code (*db_destroy)(krb5_context kcontext, char *conf_section,
- char **db_args);
+ krb5_error_code (*destroy)(krb5_context kcontext, char *conf_section,
+ char **db_args);
/*
* Optional: Set *age to the last modification time of the database. Used
* effectively expire immediately. Another option is to supply the current
* time, which will cause lookaside cache entries to last for one second.
*/
- krb5_error_code (*db_get_age)(krb5_context kcontext, char *db_name,
- time_t *age);
+ krb5_error_code (*get_age)(krb5_context kcontext, char *db_name,
+ time_t *age);
/*
* Optional: Lock the database, with semantics depending on the mode
* KRB5_PLUGIN_OP_NOTSUPP; note that this is *not* the usual "operation
* not supported" error code.
*/
- krb5_error_code (*db_lock)(krb5_context kcontext, int mode);
+ krb5_error_code (*lock)(krb5_context kcontext, int mode);
/* Optional: Release a lock created with db_lock. */
- krb5_error_code (*db_unlock)(krb5_context kcontext);
+ krb5_error_code (*unlock)(krb5_context kcontext);
/*
* Mandatory: Fill in *entries with the entry for the principal search_for.
* the module should return the entry for the cross-realm TGS of the
* referred-to realm.
*/
- krb5_error_code (*db_get_principal)(krb5_context kcontext,
- krb5_const_principal search_for,
- unsigned int flags,
- krb5_db_entry *entries, int *nentries,
- krb5_boolean *more);
+ krb5_error_code (*get_principal)(krb5_context kcontext,
+ krb5_const_principal search_for,
+ unsigned int flags,
+ krb5_db_entry *entries, int *nentries,
+ krb5_boolean *more);
/*
* Mandatory: Free the memory associated with principal entries. Do not
* allocate associated memory); thus, a plugin must allocate each field
* of a principal entry separately.
*/
- krb5_error_code (*db_free_principal)(krb5_context kcontext,
- krb5_db_entry *entry, int count);
+ krb5_error_code (*free_principal)(krb5_context kcontext,
+ krb5_db_entry *entry, int count);
/*
* Optional: Create or modify one or more principal entries. All callers
* they are specified in the mask, so it is acceptable for a module to
* ignore the mask and update the entire entry.
*/
- krb5_error_code (*db_put_principal)(krb5_context kcontext,
- krb5_db_entry *entries, int *nentries,
- char **db_args);
+ krb5_error_code (*put_principal)(krb5_context kcontext,
+ krb5_db_entry *entries, int *nentries,
+ char **db_args);
/*
* Optional: Delete the entry for the principal search_for. If the
* principal does not exist, set *nentries to 0 and return success; if it
* did exist, set *nentries to 1.
*/
- krb5_error_code (*db_delete_principal)(krb5_context kcontext,
- krb5_const_principal search_for,
- int *nentries);
+ krb5_error_code (*delete_principal)(krb5_context kcontext,
+ krb5_const_principal search_for,
+ int *nentries);
/*
* Optional: For each principal entry in the database, invoke func with the
* module may narrow the iteration to principal names matching that regular
* expression; a module may alternatively ignore match_entry.
*/
- krb5_error_code (*db_iterate)(krb5_context kcontext,
- char *match_entry,
- int (*func)(krb5_pointer, krb5_db_entry *),
- krb5_pointer func_arg);
+ krb5_error_code (*iterate)(krb5_context kcontext,
+ char *match_entry,
+ int (*func)(krb5_pointer, krb5_db_entry *),
+ krb5_pointer func_arg);
/*
* Optional: Create a password policy entry. Return an error if the policy
* already exists.
*/
- krb5_error_code (*db_create_policy)(krb5_context kcontext,
- osa_policy_ent_t policy);
+ krb5_error_code (*create_policy)(krb5_context kcontext,
+ osa_policy_ent_t policy);
/*
* Optional: If a password policy entry exists with the name name, allocate
* success, or return an error (existing module implementations are not
* consistent).
*/
- krb5_error_code (*db_get_policy)(krb5_context kcontext, char *name,
- osa_policy_ent_t *policy, int *cnt);
+ krb5_error_code (*get_policy)(krb5_context kcontext, char *name,
+ osa_policy_ent_t *policy, int *cnt);
/*
* Optional: Modify an existing password policy entry to match the values
* in policy. Return an error if the policy does not already exist.
*/
- krb5_error_code (*db_put_policy)(krb5_context kcontext,
- osa_policy_ent_t policy);
+ krb5_error_code (*put_policy)(krb5_context kcontext,
+ osa_policy_ent_t policy);
/*
* Optional: For each password policy entry in the database, invoke func
* the module may narrow the iteration to policy names matching that
* regular expression; a module may alternatively ignore match_entry.
*/
- krb5_error_code (*db_iter_policy)(krb5_context kcontext, char *match_entry,
- osa_adb_iter_policy_func func,
- void *data);
+ krb5_error_code (*iter_policy)(krb5_context kcontext, char *match_entry,
+ osa_adb_iter_policy_func func,
+ void *data);
/*
* Optional: Delete the password policy entry with the name policy. Return
* an error if the entry does not exist.
*/
- krb5_error_code (*db_delete_policy)(krb5_context kcontext, char *policy);
+ krb5_error_code (*delete_policy)(krb5_context kcontext, char *policy);
/* Optional: Free a policy entry returned by db_get_policy. */
- void (*db_free_policy)(krb5_context kcontext, osa_policy_ent_t val);
+ void (*free_policy)(krb5_context kcontext, osa_policy_ent_t val);
/*
* Mandatory: Has the semantics of realloc(ptr, size). Callers use this to
* allocate memory for new or changed principal entries, so the module
* should expect to potentially see this memory in db_free_principal.
*/
- void *(*db_alloc)(krb5_context kcontext, void *ptr, size_t size);
+ void *(*alloc)(krb5_context kcontext, void *ptr, size_t size);
/*
* Mandatory: Has the semantics of free(ptr). Callers use this to free
* fields from a principal entry (such as key data) before changing it in
* place, and in some cases to free data they allocated with db_alloc.
*/
- void (*db_free)(krb5_context kcontext, void *ptr);
+ void (*free)(krb5_context kcontext, void *ptr);
/*
* Optional with default: Inform the module of the master key. The module
* set.
*
* The default implementation uses the keyblock master_key to encrypt each
- * new key, via the function dbekd_encrypt_key_data.
+ * new key, via the function encrypt_key_data.
*/
- krb5_error_code (*db_change_pwd)(krb5_context context,
- krb5_keyblock *master_key,
- krb5_key_salt_tuple *ks_tuple,
- int ks_tuple_count, char *passwd,
- int new_kvno, krb5_boolean keepold,
- krb5_db_entry *db_entry);
+ krb5_error_code (*change_pwd)(krb5_context context,
+ krb5_keyblock *master_key,
+ krb5_key_salt_tuple *ks_tuple,
+ int ks_tuple_count, char *passwd,
+ int new_kvno, krb5_boolean keepold,
+ krb5_db_entry *db_entry);
/*
* Optional with default: Promote a temporary database to be the live one.
* stored, unencrypted, in key_data_contents[1], with length given by
* key_data_length[1].
*/
- krb5_error_code (*dbekd_decrypt_key_data)(krb5_context kcontext,
- const krb5_keyblock *mkey,
- const krb5_key_data *key_data,
- krb5_keyblock *dbkey,
- krb5_keysalt *keysalt);
+ krb5_error_code (*decrypt_key_data)(krb5_context kcontext,
+ const krb5_keyblock *mkey,
+ const krb5_key_data *key_data,
+ krb5_keyblock *dbkey,
+ krb5_keysalt *keysalt);
/*
* Optional with default: Encrypt dbkey with master keyblock mkey, placing
* in key_data_contents[1] and its length in key_data_length[1]. If
* keysalt is not specified, key_data_ver is set to 1.
*/
- krb5_error_code (*dbekd_encrypt_key_data)(krb5_context kcontext,
- const krb5_keyblock *mkey,
- const krb5_keyblock *dbkey,
- const krb5_keysalt *keysalt,
- int keyver,
- krb5_key_data *key_data);
+ krb5_error_code (*encrypt_key_data)(krb5_context kcontext,
+ const krb5_keyblock *mkey,
+ const krb5_keyblock *dbkey,
+ const krb5_keysalt *keysalt,
+ int keyver, krb5_key_data *key_data);
/*
* Optional: Perform an operation on input data req with output stored in
* not. If this method is not implemented, all S4U2Proxy delegation
* requests will be rejected. Do not place any data in rep.
*/
- krb5_error_code (*db_invoke)(krb5_context context, unsigned int method,
- const krb5_data *req, krb5_data *rep);
+ krb5_error_code (*invoke)(krb5_context context, unsigned int method,
+ const krb5_data *req, krb5_data *rep);
} kdb_vftabl;
#endif /* !defined(_WIN32) */
lib->vftabl.store_master_key_list = krb5_def_store_mkey_list;
if (lib->vftabl.dbe_search_enctype == NULL)
lib->vftabl.dbe_search_enctype = krb5_dbe_def_search_enctype;
- if (lib->vftabl.db_change_pwd == NULL)
- lib->vftabl.db_change_pwd = krb5_dbe_def_cpw;
+ if (lib->vftabl.change_pwd == NULL)
+ lib->vftabl.change_pwd = krb5_dbe_def_cpw;
if (lib->vftabl.store_master_key == NULL)
lib->vftabl.store_master_key = krb5_def_store_mkey;
if (lib->vftabl.promote_db == NULL)
lib->vftabl.promote_db = krb5_def_promote_db;
- if (lib->vftabl.dbekd_decrypt_key_data == NULL)
- lib->vftabl.dbekd_decrypt_key_data = krb5_dbe_def_decrypt_key_data;
- if (lib->vftabl.dbekd_encrypt_key_data == NULL)
- lib->vftabl.dbekd_encrypt_key_data = krb5_dbe_def_encrypt_key_data;
+ if (lib->vftabl.decrypt_key_data == NULL)
+ lib->vftabl.decrypt_key_data = krb5_dbe_def_decrypt_key_data;
+ if (lib->vftabl.encrypt_key_data == NULL)
+ lib->vftabl.encrypt_key_data = krb5_dbe_def_encrypt_key_data;
}
#ifdef STATIC_PLUGINS
status = get_vftabl(kcontext, &v);
if (status)
goto clean_n_exit;
- if (v->db_create == NULL) {
+ if (v->create == NULL) {
status = KRB5_KDB_DBTYPE_NOSUP;
goto clean_n_exit;
}
- status = v->db_create(kcontext, section, db_args);
+ status = v->create(kcontext, section, db_args);
clean_n_exit:
if (section)
status = get_vftabl(kcontext, &v);
if (status)
goto clean_n_exit;
- if (v->db_destroy == NULL) {
+ if (v->destroy == NULL) {
status = KRB5_KDB_DBTYPE_NOSUP;
goto clean_n_exit;
}
- status = v->db_destroy(kcontext, section, db_args);
+ status = v->destroy(kcontext, section, db_args);
clean_n_exit:
if (section)
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_get_age == NULL)
+ if (v->get_age == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_get_age(kcontext, db_name, t);
+ return v->get_age(kcontext, db_name, t);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_lock == NULL)
+ if (v->lock == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_lock(kcontext, lock_mode);
+ return v->lock(kcontext, lock_mode);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_unlock == NULL)
+ if (v->unlock == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_unlock(kcontext);
+ return v->unlock(kcontext);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_get_principal == NULL)
+ if (v->get_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_get_principal(kcontext, search_for, 0, entries, nentries,
- more);
+ return v->get_principal(kcontext, search_for, 0, entries, nentries, more);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_get_principal == NULL)
+ if (v->get_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_get_principal(kcontext, search_for, flags, entries, nentries,
- more);
+ return v->get_principal(kcontext, search_for, flags, entries, nentries,
+ more);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_free_principal == NULL)
+ if (v->free_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_free_principal(kcontext, entry, count);
+ return v->free_principal(kcontext, entry, count);
}
static void
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_put_principal == NULL)
+ if (v->put_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
status = extract_db_args_from_tl_data(kcontext, &entries->tl_data,
&entries->n_tl_data,
&db_args);
if (status)
return status;
- status = v->db_put_principal(kcontext, entries, nentries, db_args);
+ status = v->put_principal(kcontext, entries, nentries, db_args);
free_db_args(kcontext, db_args);
return status;
}
}
}
- if (v->db_put_principal == NULL) {
+ if (v->put_principal == NULL) {
status = KRB5_KDB_DBTYPE_NOSUP;
goto err_lock;
}
- status = v->db_put_principal(kcontext, entries, nentries, db_args);
+ status = v->put_principal(kcontext, entries, nentries, db_args);
if (status == 0 && fupd) {
upd = fupd;
for (i = 0; i < *nentries; i++) {
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_delete_principal == NULL)
+ if (v->delete_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_delete_principal(kcontext, search_for, nentries);
+ return v->delete_principal(kcontext, search_for, nentries);
}
krb5_error_code
free(princ_name);
}
- if (v->db_delete_principal == NULL)
+ if (v->delete_principal == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_delete_principal(kcontext, search_for, nentries);
+ status = v->delete_principal(kcontext, search_for, nentries);
/*
* We need to commit our update upon success
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_iterate == NULL)
+ if (v->iterate == NULL)
return 0;
- return v->db_iterate(kcontext, match_entry, func, func_arg);
+ return v->iterate(kcontext, match_entry, func, func_arg);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return NULL;
- return v->db_alloc(kcontext, ptr, size);
+ return v->alloc(kcontext, ptr, size);
}
void
status = get_vftabl(kcontext, &v);
if (status)
return;
- v->db_free(kcontext, ptr);
+ v->free(kcontext, ptr);
}
/* has to be modified */
status = get_vftabl(kcontext, &v);
if (status)
return status;
- return v->db_change_pwd(kcontext, master_key, ks_tuple, ks_tuple_count,
- passwd, new_kvno, keepold, db_entry);
+ return v->change_pwd(kcontext, master_key, ks_tuple, ks_tuple_count,
+ passwd, new_kvno, keepold, db_entry);
}
/* policy management functions */
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_create_policy == NULL)
+ if (v->create_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_create_policy(kcontext, policy);
+ return v->create_policy(kcontext, policy);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_get_policy == NULL)
+ if (v->get_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_get_policy(kcontext, name, policy, cnt);
+ return v->get_policy(kcontext, name, policy, cnt);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_put_policy == NULL)
+ if (v->put_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_put_policy(kcontext, policy);
+ return v->put_policy(kcontext, policy);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_iter_policy == NULL)
+ if (v->iter_policy == NULL)
return 0;
- return v->db_iter_policy(kcontext, match_entry, func, data);
+ return v->iter_policy(kcontext, match_entry, func, data);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_delete_policy == NULL)
+ if (v->delete_policy == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_delete_policy(kcontext, policy);
+ return v->delete_policy(kcontext, policy);
}
void
kdb_vftabl *v;
status = get_vftabl(kcontext, &v);
- if (status || v->db_free_policy == NULL)
+ if (status || v->free_policy == NULL)
return;
- v->db_free_policy(kcontext, policy);
+ v->free_policy(kcontext, policy);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- return v->dbekd_decrypt_key_data(kcontext, mkey, key_data, dbkey, keysalt);
+ return v->decrypt_key_data(kcontext, mkey, key_data, dbkey, keysalt);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- return v->dbekd_encrypt_key_data(kcontext, mkey, dbkey, keysalt, keyver,
- key_data);
+ return v->encrypt_key_data(kcontext, mkey, dbkey, keysalt, keyver,
+ key_data);
}
krb5_error_code
status = get_vftabl(kcontext, &v);
if (status)
return status;
- if (v->db_invoke == NULL)
+ if (v->invoke == NULL)
return KRB5_KDB_DBTYPE_NOSUP;
- return v->db_invoke(kcontext, method, req, rep);
+ return v->invoke(kcontext, method, req, rep);
}
char **db_args,
int mode ),
(kcontext, conf_section, db_args, mode));
-WRAP_K (krb5_db2_db_fini, (krb5_context ctx), (ctx));
+WRAP_K (krb5_db2_fini, (krb5_context ctx), (ctx));
WRAP_K (krb5_db2_create,
( krb5_context kcontext, char *conf_section, char **db_args ),
(kcontext, conf_section, db_args));
WRAP_K (krb5_db2_destroy,
( krb5_context kcontext, char *conf_section, char **db_args ),
(kcontext, conf_section, db_args));
-WRAP_K (krb5_db2_db_get_age,
+WRAP_K (krb5_db2_get_age,
(krb5_context ctx,
char *s,
time_t *t),
(ctx, s, t));
-WRAP_K (krb5_db2_db_lock,
+WRAP_K (krb5_db2_lock,
( krb5_context context,
int in_mode),
(context, in_mode));
-WRAP_K (krb5_db2_db_unlock, (krb5_context ctx), (ctx));
+WRAP_K (krb5_db2_unlock, (krb5_context ctx), (ctx));
-WRAP_K (krb5_db2_db_get_principal,
+WRAP_K (krb5_db2_get_principal,
(krb5_context ctx,
krb5_const_principal p,
unsigned int flags,
int * i,
krb5_boolean *b),
(ctx, p, d, i, b));
-WRAP_K (krb5_db2_db_free_principal,
+WRAP_K (krb5_db2_free_principal,
(krb5_context ctx,
krb5_db_entry *d,
int i),
(ctx, d, i));
-WRAP_K (krb5_db2_db_put_principal,
+WRAP_K (krb5_db2_put_principal,
(krb5_context ctx,
krb5_db_entry *d,
int *i,
char **db_args),
(ctx, d, i, db_args));
-WRAP_K (krb5_db2_db_delete_principal,
+WRAP_K (krb5_db2_delete_principal,
(krb5_context context,
krb5_const_principal searchfor,
int *nentries),
(context, searchfor, nentries));
-WRAP_K (krb5_db2_db_iterate,
+WRAP_K (krb5_db2_iterate,
(krb5_context ctx, char *s,
krb5_error_code (*f) (krb5_pointer,
krb5_db_entry *),
( krb5_context kcontext, osa_policy_ent_t entry ),
(kcontext, entry));
-WRAP_K (krb5_db2_db_set_mkey_list,
+WRAP_K (krb5_db2_set_mkey_list,
( krb5_context kcontext, krb5_keylist_node *keylist),
(kcontext, keylist));
-WRAP_K (krb5_db2_db_get_mkey_list,
+WRAP_K (krb5_db2_get_mkey_list,
( krb5_context context, krb5_keylist_node **keylist),
(context, keylist));
kdb_vftabl PLUGIN_SYMBOL_NAME(krb5_db2, kdb_function_table) = {
1, /* major version number 1 */
0, /* minor version number 0 */
- /* init_library */ hack_init,
- /* fini_library */ hack_cleanup,
- /* init_module */ wrap_krb5_db2_open,
- /* fini_module */ wrap_krb5_db2_db_fini,
- /* db_create */ wrap_krb5_db2_create,
- /* db_destroy */ wrap_krb5_db2_destroy,
- /* db_get_age */ wrap_krb5_db2_db_get_age,
- /* db_lock */ wrap_krb5_db2_db_lock,
- /* db_unlock */ wrap_krb5_db2_db_unlock,
- /* db_get_principal */ wrap_krb5_db2_db_get_principal,
- /* db_free_principal */ wrap_krb5_db2_db_free_principal,
- /* db_put_principal */ wrap_krb5_db2_db_put_principal,
- /* db_delete_principal */ wrap_krb5_db2_db_delete_principal,
- /* db_iterate */ wrap_krb5_db2_db_iterate,
- /* db_create_policy */ wrap_krb5_db2_create_policy,
- /* db_get_policy */ wrap_krb5_db2_get_policy,
- /* db_put_policy */ wrap_krb5_db2_put_policy,
- /* db_iter_policy */ wrap_krb5_db2_iter_policy,
- /* db_delete_policy */ wrap_krb5_db2_delete_policy,
- /* db_free_policy */ wrap_krb5_db2_free_policy,
- /* db_alloc */ krb5_db2_alloc,
- /* db_free */ krb5_db2_free,
- /* set_master_key_list */ wrap_krb5_db2_db_set_mkey_list,
- /* get_master_key_list */ wrap_krb5_db2_db_get_mkey_list,
+ /* init_library */ hack_init,
+ /* fini_library */ hack_cleanup,
+ /* init_module */ wrap_krb5_db2_open,
+ /* fini_module */ wrap_krb5_db2_fini,
+ /* create */ wrap_krb5_db2_create,
+ /* destroy */ wrap_krb5_db2_destroy,
+ /* get_age */ wrap_krb5_db2_get_age,
+ /* lock */ wrap_krb5_db2_lock,
+ /* unlock */ wrap_krb5_db2_unlock,
+ /* get_principal */ wrap_krb5_db2_get_principal,
+ /* free_principal */ wrap_krb5_db2_free_principal,
+ /* put_principal */ wrap_krb5_db2_put_principal,
+ /* delete_principal */ wrap_krb5_db2_delete_principal,
+ /* iterate */ wrap_krb5_db2_iterate,
+ /* create_policy */ wrap_krb5_db2_create_policy,
+ /* get_policy */ wrap_krb5_db2_get_policy,
+ /* put_policy */ wrap_krb5_db2_put_policy,
+ /* iter_policy */ wrap_krb5_db2_iter_policy,
+ /* delete_policy */ wrap_krb5_db2_delete_policy,
+ /* free_policy */ wrap_krb5_db2_free_policy,
+ /* alloc */ krb5_db2_alloc,
+ /* free */ krb5_db2_free,
+ /* set_master_key_list */ wrap_krb5_db2_set_mkey_list,
+ /* get_master_key_list */ wrap_krb5_db2_get_mkey_list,
/* blah blah blah */ 0,0,0,0,0,0,0,
- /* promote_db */ wrap_krb5_db2_promote_db,
+ /* promote_db */ wrap_krb5_db2_promote_db,
0, 0,
- /* invoke */ wrap_krb5_db2_invoke
+ /* invoke */ wrap_krb5_db2_invoke
};
#define KDB_DB2_DATABASE_NAME "database_name"
-static krb5_error_code krb5_db2_db_start_update(krb5_context);
-static krb5_error_code krb5_db2_db_end_update(krb5_context);
-
-krb5_error_code krb5_db2_db_lock(krb5_context, int);
+static krb5_error_code krb5_db2_start_update(krb5_context);
+static krb5_error_code krb5_db2_end_update(krb5_context);
/*
* Locking:
*/
krb5_error_code
-krb5_db2_db_init(krb5_context context)
+krb5_db2_init(krb5_context context)
{
char *filename = NULL;
krb5_db2_context *db_ctx;
set_cloexec_fd(db_ctx->db_lf_file);
db_ctx->db_inited++;
- if ((retval = krb5_db2_db_get_age(context, NULL, &db_ctx->db_lf_time)))
+ if ((retval = krb5_db2_get_age(context, NULL, &db_ctx->db_lf_time)))
goto err_out;
snprintf(policy_db_name, sizeof(policy_db_name), "%s%s.kadm5",
/*
* gracefully shut down database--must be called by ANY program that does
- * a krb5_db2_db_init
+ * a krb5_db2_init
*/
krb5_error_code
-krb5_db2_db_fini(krb5_context context)
+krb5_db2_fini(krb5_context context)
{
krb5_error_code retval = 0;
krb5_db2_context *db_ctx;
}
krb5_error_code
-krb5_db2_db_set_mkey_list(krb5_context context, krb5_keylist_node *key_list)
+krb5_db2_set_mkey_list(krb5_context context, krb5_keylist_node *key_list)
{
krb5_db2_context *db_ctx;
}
krb5_error_code
-krb5_db2_db_get_mkey_list(krb5_context context, krb5_keylist_node **key_list)
+krb5_db2_get_mkey_list(krb5_context context, krb5_keylist_node **key_list)
{
krb5_db2_context *db_ctx;
*/
krb5_error_code
-krb5_db2_db_get_age(krb5_context context, char *db_name, time_t *age)
+krb5_db2_get_age(krb5_context context, char *db_name, time_t *age)
{
krb5_db2_context *db_ctx;
struct stat st;
*/
static krb5_error_code
-krb5_db2_db_start_update(krb5_context context)
+krb5_db2_start_update(krb5_context context)
{
return 0;
}
static krb5_error_code
-krb5_db2_db_end_update(krb5_context context)
+krb5_db2_end_update(krb5_context context)
{
krb5_error_code retval;
krb5_db2_context *db_ctx;
#define MAX_LOCK_TRIES 5
krb5_error_code
-krb5_db2_db_lock(krb5_context context, int in_mode)
+krb5_db2_lock(krb5_context context, int in_mode)
{
krb5_db2_context *db_ctx;
int krb5_lock_mode;
else if (retval != 0)
return retval;
- if ((retval = krb5_db2_db_get_age(context, NULL, &mod_time)))
+ if ((retval = krb5_db2_get_age(context, NULL, &mod_time)))
goto lock_error;
db = k5db2_dbopen(db_ctx, db_ctx->db_name,
policy_lock:
if ((retval = osa_adb_get_lock(db_ctx->policy_db, in_mode))) {
- krb5_db2_db_unlock(context);
+ krb5_db2_unlock(context);
}
return retval;
lock_error:;
db_ctx->db_lock_mode = 0;
db_ctx->db_locks_held = 0;
- krb5_db2_db_unlock(context);
+ krb5_db2_unlock(context);
return retval;
}
krb5_error_code
-krb5_db2_db_unlock(krb5_context context)
+krb5_db2_unlock(krb5_context context)
{
krb5_db2_context *db_ctx;
DB *db;
*/
krb5_error_code
-krb5_db2_db_get_principal(krb5_context context,
- krb5_const_principal searchfor,
- krb5_db_entry *entries, /* filled in */
- int *nentries, /* how much room/how many found */
- krb5_boolean *more) /* are there more? */
+krb5_db2_get_principal(krb5_context context,
+ krb5_const_principal searchfor,
+ krb5_db_entry *entries, /* filled in */
+ int *nentries, /* how much room/how many found */
+ krb5_boolean *more) /* are there more? */
{
krb5_db2_context *db_ctx;
krb5_error_code retval;
db_ctx = context->dal_handle->db_context;
for (trynum = 0; trynum < KRB5_DB2_MAX_RETRY; trynum++) {
- if ((retval = krb5_db2_db_lock(context, KRB5_LOCKMODE_SHARED))) {
+ if ((retval = krb5_db2_lock(context, KRB5_LOCKMODE_SHARED))) {
if (db_ctx->db_nb_locks)
return (retval);
sleep(1);
}
cleanup:
- (void) krb5_db2_db_unlock(context); /* unlock read lock */
+ (void) krb5_db2_unlock(context); /* unlock read lock */
return retval;
}
/*
- Free stuff returned by krb5_db2_db_get_principal.
+ Free stuff returned by krb5_db2_get_principal.
*/
krb5_error_code
-krb5_db2_db_free_principal(krb5_context context, krb5_db_entry *entries,
- int nentries)
+krb5_db2_free_principal(krb5_context context, krb5_db_entry *entries,
+ int nentries)
{
register int i;
for (i = 0; i < nentries; i++)
*/
krb5_error_code
-krb5_db2_db_put_principal(krb5_context context,
- krb5_db_entry *entries,
- int *nentries, /* number of entry structs to update */
- char **db_args)
+krb5_db2_put_principal(krb5_context context, krb5_db_entry *entries,
+ int *nentries, /* number of entry structs to update */
+ char **db_args)
{
int i, n, dbret;
DB *db;
return KRB5_KDB_DBNOTINITED;
db_ctx = context->dal_handle->db_context;
- if ((retval = krb5_db2_db_lock(context, KRB5_LOCKMODE_EXCLUSIVE)))
+ if ((retval = krb5_db2_lock(context, KRB5_LOCKMODE_EXCLUSIVE)))
return retval;
db = db_ctx->db;
- if ((retval = krb5_db2_db_start_update(context))) {
- (void) krb5_db2_db_unlock(context);
+ if ((retval = krb5_db2_start_update(context))) {
+ (void) krb5_db2_unlock(context);
return retval;
}
entries++; /* bump to next struct */
}
- (void) krb5_db2_db_end_update(context);
- (void) krb5_db2_db_unlock(context); /* unlock database */
+ (void) krb5_db2_end_update(context);
+ (void) krb5_db2_unlock(context); /* unlock database */
*nentries = i;
return (retval);
}
*/
krb5_error_code
-krb5_db2_db_delete_principal(krb5_context context,
- krb5_const_principal searchfor,
- int *nentries) /* how many found & deleted */
+krb5_db2_delete_principal(krb5_context context, krb5_const_principal searchfor,
+ int *nentries) /* how many found & deleted */
{
krb5_error_code retval;
krb5_db_entry entry;
return KRB5_KDB_DBNOTINITED;
db_ctx = context->dal_handle->db_context;
- if ((retval = krb5_db2_db_lock(context, KRB5_LOCKMODE_EXCLUSIVE)))
+ if ((retval = krb5_db2_lock(context, KRB5_LOCKMODE_EXCLUSIVE)))
return (retval);
- if ((retval = krb5_db2_db_start_update(context))) {
- (void) krb5_db2_db_unlock(context); /* unlock write lock */
+ if ((retval = krb5_db2_start_update(context))) {
+ (void) krb5_db2_unlock(context); /* unlock write lock */
return (retval);
}
krb5_free_data_contents(context, &keydata);
cleanup:
- (void) krb5_db2_db_end_update(context);
- (void) krb5_db2_db_unlock(context); /* unlock write lock */
+ (void) krb5_db2_end_update(context);
+ (void) krb5_db2_unlock(context); /* unlock write lock */
return retval;
}
krb5_error_code
-krb5_db2_db_iterate_ext(krb5_context context,
- krb5_error_code(*func) (krb5_pointer, krb5_db_entry *),
- krb5_pointer func_arg,
- int backwards, int recursive)
+krb5_db2_iterate_ext(krb5_context context,
+ krb5_error_code(*func) (krb5_pointer, krb5_db_entry *),
+ krb5_pointer func_arg, int backwards, int recursive)
{
krb5_db2_context *db_ctx;
DB *db;
return KRB5_KDB_DBNOTINITED;
db_ctx = context->dal_handle->db_context;
- retval = krb5_db2_db_lock(context, KRB5_LOCKMODE_SHARED);
+ retval = krb5_db2_lock(context, KRB5_LOCKMODE_SHARED);
if (retval)
return retval;
db = db_ctx->db;
if (recursive && db->type != DB_BTREE) {
- (void) krb5_db2_db_unlock(context);
+ (void) krb5_db2_unlock(context);
return KRB5_KDB_UK_RERROR; /* Not optimal, but close enough. */
}
dbret = bt_rseq(db, &key, &contents, &cookie,
backwards ? R_LAST : R_FIRST);
#else
- (void) krb5_db2_db_unlock(context);
+ (void) krb5_db2_unlock(context);
return KRB5_KDB_UK_RERROR; /* Not optimal, but close enough. */
#endif
}
dbret = bt_rseq(db, &key, &contents, &cookie,
backwards ? R_PREV : R_NEXT);
#else
- (void) krb5_db2_db_unlock(context);
+ (void) krb5_db2_unlock(context);
return KRB5_KDB_UK_RERROR; /* Not optimal, but close enough. */
#endif
}
default:
retval = errno;
}
- (void) krb5_db2_db_unlock(context);
+ (void) krb5_db2_unlock(context);
return retval;
}
krb5_error_code
-krb5_db2_db_iterate(krb5_context context,
- char *match_expr,
- krb5_error_code(*func) (krb5_pointer, krb5_db_entry *),
- krb5_pointer func_arg)
+krb5_db2_iterate(krb5_context context, char *match_expr,
+ krb5_error_code(*func) (krb5_pointer, krb5_db_entry *),
+ krb5_pointer func_arg)
{
- return krb5_db2_db_iterate_ext(context, func, func_arg, 0, 0);
+ return krb5_db2_iterate_ext(context, func, func_arg, 0, 0);
}
krb5_boolean
-krb5_db2_db_set_lockmode(krb5_context context, krb5_boolean mode)
+krb5_db2_set_lockmode(krb5_context context, krb5_boolean mode)
{
krb5_boolean old;
krb5_db2_context *db_ctx;
if (status != 0)
return status;
- return krb5_db2_db_init(context);
+ return krb5_db2_init(context);
}
krb5_error_code
if (status != 0)
return status;
- return krb5_db2_db_init(context);
+ return krb5_db2_init(context);
}
krb5_error_code
krb5_db2_context *db_ctx;
if (k5db2_inited(context)) {
- status = krb5_db2_db_fini(context);
+ status = krb5_db2_fini(context);
if (status != 0)
return status;
}
}
}
- status = krb5_db2_db_rename (context, temp_db_name, db_name, merge_nra);
+ status = krb5_db2_rename(context, temp_db_name, db_name, merge_nra);
if (status)
goto clean_n_exit;
dal_handle->db_context = nra->db_context;
/* look up the new principal in the old DB */
- retval = krb5_db2_db_get_principal(nra->kcontext,
- entry->princ,
- &s_entry,
- &n_entries,
- &more);
+ retval = krb5_db2_get_principal(nra->kcontext, entry->princ, &s_entry,
+ &n_entries, &more);
if (retval != 0 || n_entries == 0) {
/* principal may be newly created, so ignore */
dal_handle->db_context = dst_db;
/* if necessary, commit the modified new entry to the new DB */
if (changed) {
- retval = krb5_db2_db_put_principal(nra->kcontext,
- entry,
- &n_entries,
- NULL);
+ retval = krb5_db2_put_principal(nra->kcontext, entry, &n_entries,
+ NULL);
} else {
retval = 0;
}
assert(dal_handle->db_context == dst_db);
dal_handle->db_context = src_db;
- retval = krb5_db2_db_lock(context, KRB5_LOCKMODE_EXCLUSIVE);
+ retval = krb5_db2_lock(context, KRB5_LOCKMODE_EXCLUSIVE);
if (retval) {
dal_handle->db_context = dst_db;
return retval;
}
- retval = krb5_db2_db_iterate_ext(context,
- krb5_db2_merge_nra_iterator,
- &nra,
- 0,
- 0);
+ retval = krb5_db2_iterate_ext(context, krb5_db2_merge_nra_iterator,
+ &nra, 0, 0);
if (retval != 0)
- (void) krb5_db2_db_unlock(context);
+ (void) krb5_db2_unlock(context);
dal_handle->db_context = dst_db;
kdb5_dal_handle *dal_handle = context->dal_handle;
dal_handle->db_context = src_db;
- retval = krb5_db2_db_unlock(context);
+ retval = krb5_db2_unlock(context);
dal_handle->db_context = dst_db;
return retval;
* have to go through the same stuff that we went through up in db_destroy.
*/
krb5_error_code
-krb5_db2_db_rename(context, from, to, merge_nra)
- krb5_context context;
- char *from;
- char *to;
- int merge_nra;
+krb5_db2_rename(krb5_context context, char *from, char *to, int merge_nra)
{
char *fromok;
krb5_error_code retval;
/*
* Create the database if it does not already exist; the
- * files must exist because krb5_db2_db_lock, called below,
+ * files must exist because krb5_db2_lock, called below,
* will fail otherwise.
*/
retval = create_db(context, to);
if (retval)
goto errout;
- retval = krb5_db2_db_init(context);
+ retval = krb5_db2_init(context);
if (retval)
goto errout;
db_ctx->db_inited = 1;
- retval = krb5_db2_db_get_age(context, NULL, &db_ctx->db_lf_time);
+ retval = krb5_db2_get_age(context, NULL, &db_ctx->db_lf_time);
if (retval)
goto errout;
goto errout;
}
- if ((retval = krb5_db2_db_lock(context, KRB5_LOCKMODE_EXCLUSIVE)))
+ if ((retval = krb5_db2_lock(context, KRB5_LOCKMODE_EXCLUSIVE)))
goto errfromok;
- if ((retval = krb5_db2_db_start_update(context)))
+ if ((retval = krb5_db2_start_update(context)))
goto errfromok;
if (merge_nra) {
krb5_db2_end_nra_merge(context, s_context, db_ctx);
}
- retval = krb5_db2_db_end_update(context);
+ retval = krb5_db2_end_update(context);
if (retval)
goto errfromok;
errout:
if (dal_handle->db_context) {
if (db_ctx->db_lf_file >= 0) {
- krb5_db2_db_unlock(context);
+ krb5_db2_unlock(context);
close(db_ctx->db_lf_file);
}
k5db2_clear_context((krb5_db2_context *) dal_handle->db_context);
}
dal_handle->db_context = s_context;
- (void) krb5_db2_db_unlock(context); /* unlock saved context db */
+ (void) krb5_db2_unlock(context); /* unlock saved context db */
return retval;
}
#define KDB2_LOCK_EXT ".ok"
#define KDB2_TEMP_LOCK_EXT "~.ok"
-krb5_error_code krb5_db2_db_init(krb5_context);
-krb5_error_code krb5_db2_db_fini(krb5_context);
-krb5_error_code krb5_db2_db_get_age(krb5_context, char *, time_t *);
-krb5_error_code krb5_db2_db_rename(krb5_context, char *, char *, int );
-krb5_error_code krb5_db2_db_get_principal(krb5_context, krb5_const_principal,
- krb5_db_entry *, int *,
- krb5_boolean *);
-krb5_error_code krb5_db2_db_free_principal(krb5_context, krb5_db_entry *, int);
-krb5_error_code krb5_db2_db_put_principal(krb5_context, krb5_db_entry *,
- int *, char **db_args);
-krb5_error_code krb5_db2_db_iterate_ext(krb5_context,
- krb5_error_code (*)(krb5_pointer,
- krb5_db_entry *),
- krb5_pointer, int, int);
-krb5_error_code krb5_db2_db_iterate(krb5_context, char *,
- krb5_error_code (*)(krb5_pointer,
- krb5_db_entry *),
- krb5_pointer);
-krb5_error_code krb5_db2_db_set_nonblocking(krb5_context, krb5_boolean,
- krb5_boolean *);
-krb5_boolean krb5_db2_db_set_lockmode(krb5_context, krb5_boolean);
-krb5_error_code krb5_db2_db_open_database(krb5_context);
-krb5_error_code krb5_db2_db_close_database(krb5_context);
+krb5_error_code krb5_db2_init(krb5_context);
+krb5_error_code krb5_db2_fini(krb5_context);
+krb5_error_code krb5_db2_get_age(krb5_context, char *, time_t *);
+krb5_error_code krb5_db2_rename(krb5_context, char *, char *, int );
+krb5_error_code krb5_db2_get_principal(krb5_context, krb5_const_principal,
+ krb5_db_entry *, int *, krb5_boolean *);
+krb5_error_code krb5_db2_free_principal(krb5_context, krb5_db_entry *, int);
+krb5_error_code krb5_db2_put_principal(krb5_context, krb5_db_entry *, int *,
+ char **db_args);
+krb5_error_code krb5_db2_iterate_ext(krb5_context,
+ krb5_error_code (*)(krb5_pointer,
+ krb5_db_entry *),
+ krb5_pointer, int, int);
+krb5_error_code krb5_db2_iterate(krb5_context, char *,
+ krb5_error_code (*)(krb5_pointer,
+ krb5_db_entry *),
+ krb5_pointer);
+krb5_error_code krb5_db2_set_nonblocking(krb5_context, krb5_boolean,
+ krb5_boolean *);
+krb5_boolean krb5_db2_set_lockmode(krb5_context, krb5_boolean);
+krb5_error_code krb5_db2_open_database(krb5_context);
+krb5_error_code krb5_db2_close_database(krb5_context);
krb5_error_code
-krb5_db2_db_set_mkey_list(krb5_context context, krb5_keylist_node *keylist);
+krb5_db2_set_mkey_list(krb5_context context, krb5_keylist_node *keylist);
krb5_error_code
-krb5_db2_db_get_mkey_list(krb5_context context, krb5_keylist_node **keylist);
+krb5_db2_get_mkey_list(krb5_context context, krb5_keylist_node **keylist);
krb5_error_code
-krb5_db2_db_put_principal(krb5_context context, krb5_db_entry *entries,
- register int *nentries, char **db_args);
+krb5_db2_put_principal(krb5_context context, krb5_db_entry *entries,
+ register int *nentries, char **db_args);
krb5_error_code
-krb5_db2_db_delete_principal(krb5_context context,
- krb5_const_principal searchfor, int *nentries);
+krb5_db2_delete_principal(krb5_context context, krb5_const_principal searchfor,
+ int *nentries);
krb5_error_code krb5_db2_lib_init(void);
krb5_error_code krb5_db2_lib_cleanup(void);
-krb5_error_code krb5_db2_db_unlock(krb5_context);
+krb5_error_code krb5_db2_unlock(krb5_context);
krb5_error_code
krb5_db2_promote_db(krb5_context kcontext, char *conf_section, char **db_args);
krb5_error_code
-krb5_db2_db_set_option(krb5_context kcontext, int option, void *value );
-
-krb5_error_code
-krb5_db2_db_lock(krb5_context context, int in_mode);
+krb5_db2_lock(krb5_context context, int in_mode);
krb5_error_code
krb5_db2_open(krb5_context kcontext, char *conf_section, char **db_args,
}
if (need_update) {
- code = krb5_db2_db_put_principal(context, entry, &nentries, NULL);
+ code = krb5_db2_put_principal(context, entry, &nentries, NULL);
if (code != 0)
return code;
}
/* fini_library */ krb5_ldap_lib_cleanup,
/* init_module */ krb5_ldap_open,
/* fini_module */ krb5_ldap_close,
- /* db_create */ krb5_ldap_create,
- /* db_destroy */ krb5_ldap_delete_realm_1,
- /* db_get_age */ krb5_ldap_db_get_age,
- /* db_lock */ krb5_ldap_lock,
- /* db_unlock */ krb5_ldap_unlock,
- /* db_get_principal */ krb5_ldap_get_principal,
- /* db_free_principal */ krb5_ldap_free_principal,
- /* db_put_principal */ krb5_ldap_put_principal,
- /* db_delete_principal */ krb5_ldap_delete_principal,
- /* db_iterate */ krb5_ldap_iterate,
- /* db_create_policy */ krb5_ldap_create_password_policy,
- /* db_get_policy */ krb5_ldap_get_password_policy,
- /* db_put_policy */ krb5_ldap_put_password_policy,
- /* db_iter_policy */ krb5_ldap_iterate_password_policy,
- /* db_delete_policy */ krb5_ldap_delete_password_policy,
- /* db_free_policy */ krb5_ldap_free_password_policy,
- /* db_alloc */ krb5_ldap_alloc,
- /* db_free */ krb5_ldap_free,
+ /* create */ krb5_ldap_create,
+ /* destroy */ krb5_ldap_delete_realm_1,
+ /* get_age */ krb5_ldap_get_age,
+ /* lock */ krb5_ldap_lock,
+ /* unlock */ krb5_ldap_unlock,
+ /* get_principal */ krb5_ldap_get_principal,
+ /* free_principal */ krb5_ldap_free_principal,
+ /* put_principal */ krb5_ldap_put_principal,
+ /* delete_principal */ krb5_ldap_delete_principal,
+ /* iterate */ krb5_ldap_iterate,
+ /* create_policy */ krb5_ldap_create_password_policy,
+ /* get_policy */ krb5_ldap_get_password_policy,
+ /* put_policy */ krb5_ldap_put_password_policy,
+ /* iter_policy */ krb5_ldap_iterate_password_policy,
+ /* delete_policy */ krb5_ldap_delete_password_policy,
+ /* free_policy */ krb5_ldap_free_password_policy,
+ /* alloc */ krb5_ldap_alloc,
+ /* free */ krb5_ldap_free,
/* optional functions */
/* set_master_key_list */ krb5_ldap_set_mkey_list,
/* get_master_key_list */ krb5_ldap_get_mkey_list,
/* Search enc type */ NULL,
/* Change pwd */ NULL,
/* promote_db */ NULL,
- /* dbekd_decrypt_key_data */ NULL,
- /* dbekd_encrypt_key_data */ NULL,
- /* db_invoke */ krb5_ldap_invoke,
+ /* decrypt_key_data */ NULL,
+ /* encrypt_key_data */ NULL,
+ /* invoke */ krb5_ldap_invoke,
};
* ldap get age
*/
krb5_error_code
-krb5_ldap_db_get_age(context, db_name, age)
+krb5_ldap_get_age(context, db_name, age)
krb5_context context;
char *db_name;
time_t *age;
krb5_ldap_rebind(krb5_ldap_context *, krb5_ldap_server_handle **);
krb5_error_code
-krb5_ldap_db_get_age(krb5_context, char *, time_t *);
+krb5_ldap_get_age(krb5_context, char *, time_t *);
krb5_error_code
krb5_ldap_lib_init(int dal_version);
krb5_ldap_db_init
krb5_ldap_lib_init
krb5_ldap_lib_cleanup
-krb5_ldap_db_get_age
+krb5_ldap_get_age
krb5_ldap_read_server_params
krb5_ldap_put_principal
krb5_ldap_get_principal