We honour settings to specify the location of the KDB and stash file.
This commit is contained in:
@@ -47,12 +47,25 @@ kadm5_s_init_with_context(krb5_context context,
|
|||||||
{
|
{
|
||||||
kadm5_ret_t ret;
|
kadm5_ret_t ret;
|
||||||
kadm5_server_context *ctx;
|
kadm5_server_context *ctx;
|
||||||
|
char *dbname;
|
||||||
|
char *stash_file;
|
||||||
|
|
||||||
ret = _kadm5_s_init_context(&ctx, realm_params, context);
|
ret = _kadm5_s_init_context(&ctx, realm_params, context);
|
||||||
if(ret)
|
if(ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
assert(ctx->config.dbname != NULL);
|
if (realm_params->mask & KADM5_CONFIG_DBNAME)
|
||||||
assert(ctx->config.stash_file != NULL);
|
dbname = realm_params->dbname;
|
||||||
|
else
|
||||||
|
dbname = ctx->config.dbname;
|
||||||
|
|
||||||
|
if (realm_params->mask & KADM5_CONFIG_STASH_FILE)
|
||||||
|
stash_file = realm_params->stash_file;
|
||||||
|
else
|
||||||
|
stash_file = ctx->config.stash_file;
|
||||||
|
|
||||||
|
assert(dbname != NULL);
|
||||||
|
assert(stash_file != NULL);
|
||||||
assert(ctx->config.acl_file != NULL);
|
assert(ctx->config.acl_file != NULL);
|
||||||
assert(ctx->log_context.log_file != NULL);
|
assert(ctx->log_context.log_file != NULL);
|
||||||
#ifndef NO_UNIX_SOCKETS
|
#ifndef NO_UNIX_SOCKETS
|
||||||
@@ -61,11 +74,11 @@ kadm5_s_init_with_context(krb5_context context,
|
|||||||
assert(ctx->log_context.socket_info != NULL);
|
assert(ctx->log_context.socket_info != NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = hdb_create(ctx->context, &ctx->db, ctx->config.dbname);
|
ret = hdb_create(ctx->context, &ctx->db, dbname);
|
||||||
if(ret)
|
if(ret)
|
||||||
return ret;
|
return ret;
|
||||||
ret = hdb_set_master_keyfile (ctx->context,
|
ret = hdb_set_master_keyfile (ctx->context,
|
||||||
ctx->db, ctx->config.stash_file);
|
ctx->db, stash_file);
|
||||||
if(ret)
|
if(ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user