krb5_error_code krb5_db_destroy ( krb5_context kcontext, char **db_args );
krb5_error_code krb5_db_promote ( krb5_context kcontext, char **db_args );
krb5_error_code krb5_db_get_age ( krb5_context kcontext, char *db_name, time_t *t );
-krb5_error_code krb5_db_set_option ( krb5_context kcontext, int option, void *value );
krb5_error_code krb5_db_lock ( krb5_context kcontext, int lock_mode );
krb5_error_code krb5_db_unlock ( krb5_context kcontext );
krb5_error_code krb5_db_get_principal ( krb5_context kcontext,
krb5_error_code (*db_get_age)(krb5_context kcontext, char *db_name,
time_t *age);
- /*
- * Optional: Set a database option. This function is not currently used by
- * any callers. Behavior depends on the value of option:
- *
- * KRB5_KDB_OPT_SET_DB_NAME: Interpret value as a C string. Set the
- * database name (e.g. a filename for an embedded database).
- *
- * KRB5_KDB_OPT_SET_LOCK_MODE: Interpret value as a pointer to
- * krb5_boolean. If *value points to TRUE, set the database to
- * non-blocking lock mode, causing operations to return OSA_ADB_CANTLOCK_DB
- * when it would otherwise wait to obtain a lock. Set *value to the old
- * value of the non-blocking flag.
- */
- krb5_error_code (*db_set_option)(krb5_context kcontext, int option,
- void *value);
-
/*
* Optional: Lock the database, with semantics depending on the mode
* argument:
return status;
}
-krb5_error_code
-krb5_db_set_option(krb5_context kcontext, int option, void *value)
-{
- krb5_error_code status = 0;
- kdb_vftabl *v;
-
- status = get_vftabl(kcontext, &v);
- if (status)
- return status;
- if (v->db_set_option == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
- status = v->db_set_option(kcontext, option, value);
- get_errmsg(kcontext, status);
- return status;
-}
-
krb5_error_code
krb5_db_lock(krb5_context kcontext, int lock_mode)
{
char *s,
time_t *t),
(ctx, s, t));
-WRAP_K (krb5_db2_db_set_option,
- ( krb5_context kcontext,
- int option,
- void *value ),
- (kcontext, option, value));
WRAP_K (krb5_db2_db_lock,
( krb5_context context,
/* db_create */ wrap_krb5_db2_create,
/* db_destroy */ wrap_krb5_db2_destroy,
/* db_get_age */ wrap_krb5_db2_db_get_age,
- /* db_set_option */ wrap_krb5_db2_db_set_option,
/* db_lock */ wrap_krb5_db2_db_lock,
/* db_unlock */ wrap_krb5_db2_db_unlock,
/* db_get_principal */ wrap_krb5_db2_db_get_principal,
return krb5_db2_db_set_mkey(kcontext, key);
}
-krb5_error_code
-krb5_db2_db_set_option(krb5_context kcontext, int option, void *value)
-{
- krb5_error_code status = 0;
- krb5_boolean oldval;
- krb5_db2_context *db_ctx;
- kdb5_dal_handle *dal_handle;
-
- if (!k5db2_inited(kcontext))
- return KRB5_KDB_DBNOTINITED;
-
- dal_handle = kcontext->dal_handle;
- db_ctx = (krb5_db2_context *) dal_handle->db_context;
-
-
- switch (option) {
- case KRB5_KDB_OPT_SET_DB_NAME:
- status = krb5_db2_db_set_name(kcontext, (char *) value, db_ctx->tempdb);
- break;
-
- case KRB5_KDB_OPT_SET_LOCK_MODE:
- oldval = krb5_db2_db_set_lockmode(kcontext, *((krb5_boolean *) value));
- *((krb5_boolean *) value) = oldval;
- break;
-
- default:
- status = -1; /* TBD */
- break;
- }
-
- return status;
-}
-
void *
krb5_db2_alloc(krb5_context kcontext, void *ptr, size_t size)
{
return KRB5_KDB_DBTYPE_NOSUP;
}
-static krb5_error_code
-kh_db_set_option(krb5_context context,
- int option,
- void *value)
-{
- return KRB5_KDB_DBTYPE_NOSUP;
-}
-
static krb5_error_code
kh_db_lock(krb5_context context, int kmode)
{
kh_db_create,
kh_db_destroy,
kh_db_get_age,
- kh_db_set_option,
kh_db_lock,
kh_db_unlock,
kh_db_get_principal,
/* db_create */ krb5_ldap_create,
/* db_destroy */ krb5_ldap_delete_realm_1,
/* db_get_age */ krb5_ldap_db_get_age,
- /* db_set_option */ krb5_ldap_set_option,
/* db_lock */ krb5_ldap_lock,
/* db_unlock */ krb5_ldap_unlock,
/* db_get_principal */ krb5_ldap_get_principal,
/* DAL functions */
-krb5_error_code
-krb5_ldap_set_option( krb5_context, int, void * );
-
krb5_error_code
krb5_ldap_lock( krb5_context, int );
return 0;
}
-krb5_error_code
-krb5_ldap_set_option(krb5_context kcontext, int option, void *value)
-{
- krb5_error_code status = KRB5_PLUGIN_OP_NOTSUPP;
- krb5_set_error_message(kcontext, status, "LDAP %s", error_message(status));
- return status;
-}
-
krb5_error_code
krb5_ldap_lock(krb5_context kcontext, int mode)
{