iprop: Fix default dbname choice on initial prop
If a DB does not already exist, ipropd-slave will use the compiled default, which is not necessarily what is desired or configured in `[kdc]`. This change makes `hdb_default_db()` return the first dbanme in the `[kdc]` configuration, falling back on `HDB_DEFAULT_DB`. Also, this adds a `--database` option to `ipropd-slave`.
This commit is contained in:
@@ -676,6 +676,7 @@ is_up_to_date(krb5_context context, const char *file,
|
||||
(unsigned long)server_context->log_context.version, buf);
|
||||
}
|
||||
|
||||
static char *database;
|
||||
static char *status_file;
|
||||
static char *config_file;
|
||||
static int version_flag;
|
||||
@@ -688,6 +689,7 @@ static int daemon_child = -1;
|
||||
static struct getargs args[] = {
|
||||
{ "config-file", 'c', arg_string, &config_file, NULL, NULL },
|
||||
{ "realm", 'r', arg_string, &realm, NULL, NULL },
|
||||
{ "database", 'd', arg_string, &database, "database", "file"},
|
||||
{ "keytab", 'k', arg_string, &keytab_str,
|
||||
"keytab to get authentication from", "kspec" },
|
||||
{ "time-lost", 0, arg_string, &server_time_lost,
|
||||
@@ -813,6 +815,10 @@ main(int argc, char **argv)
|
||||
conf.mask |= KADM5_CONFIG_REALM;
|
||||
conf.realm = realm;
|
||||
}
|
||||
if (database) {
|
||||
conf.mask |= KADM5_CONFIG_DBNAME;
|
||||
conf.dbname = database;
|
||||
}
|
||||
ret = kadm5_init_with_password_ctx (context,
|
||||
KADM5_ADMIN_SERVICE,
|
||||
NULL,
|
||||
|
Reference in New Issue
Block a user