kadmin: add --hdb / -H argument

Makes it possible to

 $ kadmin -l -H /tmp/hdb init FOO.EXAMPLE

rather than being able to only init /var/heimdal/heimdal.
This commit is contained in:
Nicolas Williams
2019-08-21 14:35:30 -05:00
parent 338d47120b
commit 5859bc3bdf
2 changed files with 12 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ int local_flag;
static int ad_flag;
static int help_flag;
static int version_flag;
static char *hdb;
static char *realm;
static char *admin_server;
static int server_port = 0;
@@ -63,6 +64,10 @@ static struct getargs args[] = {
"key-file", 'k', arg_string, &keyfile,
"location of master key file", "file"
},
{
"hdb", 'H', arg_string, &hdb,
"HDB to use", "hdb"
},
{
"realm", 'r', arg_string, &realm,
"realm to use", "realm"
@@ -204,6 +209,11 @@ main(int argc, char **argv)
conf.mask |= KADM5_CONFIG_REALM;
}
if (hdb) {
conf.dbname = hdb;
conf.mask |= KADM5_CONFIG_DBNAME;
}
if (admin_server) {
conf.admin_server = admin_server;
conf.mask |= KADM5_CONFIG_ADMIN_SERVER;