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:
		| @@ -69,6 +69,8 @@ principal to authenticate as | |||||||
| keytab for authentication principal | keytab for authentication principal | ||||||
| .It Fl c Ar file , Fl Fl config-file= Ns Ar file | .It Fl c Ar file , Fl Fl config-file= Ns Ar file | ||||||
| location of config file | location of config file | ||||||
|  | .It Fl H Ar HDB , Fl Fl hdb= Ns Ar HDB | ||||||
|  | location of HDB | ||||||
| .It Fl k Ar file , Fl Fl key-file= Ns Ar file | .It Fl k Ar file , Fl Fl key-file= Ns Ar file | ||||||
| location of master key file | location of master key file | ||||||
| .It Fl r Ar realm , Fl Fl realm= Ns Ar realm | .It Fl r Ar realm , Fl Fl realm= Ns Ar realm | ||||||
|   | |||||||
| @@ -41,6 +41,7 @@ int local_flag; | |||||||
| static int ad_flag; | static int ad_flag; | ||||||
| static int help_flag; | static int help_flag; | ||||||
| static int version_flag; | static int version_flag; | ||||||
|  | static char *hdb; | ||||||
| static char *realm; | static char *realm; | ||||||
| static char *admin_server; | static char *admin_server; | ||||||
| static int server_port = 0; | static int server_port = 0; | ||||||
| @@ -63,6 +64,10 @@ static struct getargs args[] = { | |||||||
| 	"key-file",	'k',	arg_string, &keyfile, | 	"key-file",	'k',	arg_string, &keyfile, | ||||||
| 	"location of master key file", "file" | 	"location of master key file", "file" | ||||||
|     }, |     }, | ||||||
|  |     { | ||||||
|  | 	"hdb",	'H',	arg_string,   &hdb, | ||||||
|  | 	"HDB to use", "hdb" | ||||||
|  |     }, | ||||||
|     { |     { | ||||||
| 	"realm",	'r',	arg_string,   &realm, | 	"realm",	'r',	arg_string,   &realm, | ||||||
| 	"realm to use", "realm" | 	"realm to use", "realm" | ||||||
| @@ -204,6 +209,11 @@ main(int argc, char **argv) | |||||||
| 	conf.mask |= KADM5_CONFIG_REALM; | 	conf.mask |= KADM5_CONFIG_REALM; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if (hdb) { | ||||||
|  | 	conf.dbname = hdb; | ||||||
|  | 	conf.mask |= KADM5_CONFIG_DBNAME; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     if (admin_server) { |     if (admin_server) { | ||||||
| 	conf.admin_server = admin_server; | 	conf.admin_server = admin_server; | ||||||
| 	conf.mask |= KADM5_CONFIG_ADMIN_SERVER; | 	conf.mask |= KADM5_CONFIG_ADMIN_SERVER; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Nicolas Williams
					Nicolas Williams