Update to use remote protocol.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3794 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -45,6 +45,8 @@ static char *config_file;
|
|||||||
static char *keyfile;
|
static char *keyfile;
|
||||||
static int help_flag;
|
static int help_flag;
|
||||||
static int version_flag;
|
static int version_flag;
|
||||||
|
static char *realm;
|
||||||
|
static char *admin_server;
|
||||||
|
|
||||||
static struct getargs args[] = {
|
static struct getargs args[] = {
|
||||||
{
|
{
|
||||||
@@ -55,6 +57,14 @@ 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"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"realm", 'r', arg_string, &realm,
|
||||||
|
"realm to use", "realm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"admin-server", 'a', arg_string, &admin_server,
|
||||||
|
"server to contact", "host"
|
||||||
|
},
|
||||||
{ "help", 'h', arg_flag, &help_flag },
|
{ "help", 'h', arg_flag, &help_flag },
|
||||||
{ "version", 'v', arg_flag, &version_flag }
|
{ "version", 'v', arg_flag, &version_flag }
|
||||||
};
|
};
|
||||||
@@ -62,15 +72,16 @@ static struct getargs args[] = {
|
|||||||
static int num_args = sizeof(args) / sizeof(args[0]);
|
static int num_args = sizeof(args) / sizeof(args[0]);
|
||||||
|
|
||||||
static SL_cmd commands[] = {
|
static SL_cmd commands[] = {
|
||||||
{ "add_new_key", add_new_key, "add_new_key principal"},
|
{ "add_new_key", add_new_key, "add_new_key principal"},
|
||||||
{ "ank"},
|
{ "ank"},
|
||||||
{ "cpw", cpw_entry, "cpw_entry principal..."},
|
{ "cpw", cpw_entry, "cpw_entry principal..."},
|
||||||
{ "change_password"},
|
{ "change_password"},
|
||||||
{ "passwd"},
|
{ "passwd"},
|
||||||
{ "del_entry", del_entry, "del_entry principal..."},
|
{ "del_entry", del_entry, "del_entry principal..."},
|
||||||
{ "delete" },
|
{ "delete" },
|
||||||
{ "ext_keytab", ext_keytab, "ext_keytab principal..."},
|
{ "ext_keytab", ext_keytab, "ext_keytab principal..."},
|
||||||
{ "get_entry", get_entry, "get_entry principal"},
|
{ "get_entry", get_entry, "get_entry principal"},
|
||||||
|
{ "rename", rename_entry, "rename source target"},
|
||||||
{ "help", help, "help"},
|
{ "help", help, "help"},
|
||||||
{ "?"},
|
{ "?"},
|
||||||
{ "exit", exit_kadmin, "exit"},
|
{ "exit", exit_kadmin, "exit"},
|
||||||
@@ -105,6 +116,7 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
krb5_config_section *cf;
|
krb5_config_section *cf;
|
||||||
|
kadm5_config_params conf;
|
||||||
int optind = 0;
|
int optind = 0;
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
@@ -133,13 +145,24 @@ main(int argc, char **argv)
|
|||||||
keyfile = strdup(p);
|
keyfile = strdup(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(&conf, 0, sizeof(conf));
|
||||||
|
conf.realm = realm;
|
||||||
|
conf.mask |= KADM5_CONFIG_REALM;
|
||||||
|
krb5_set_default_realm(context, realm); /* XXX should be fixed
|
||||||
|
some other way */
|
||||||
|
conf.admin_server = admin_server;
|
||||||
|
conf.mask |= KADM5_CONFIG_ADMIN_SERVER;
|
||||||
|
|
||||||
ret = kadm5_init_with_password_ctx(context,
|
ret = kadm5_init_with_password_ctx(context,
|
||||||
|
/* XXX these are not used */
|
||||||
"client",
|
"client",
|
||||||
"password",
|
"password",
|
||||||
"service",
|
"service",
|
||||||
NULL, 0, 0,
|
&conf, 0, 0,
|
||||||
&kadm_handle);
|
&kadm_handle);
|
||||||
|
|
||||||
|
if(ret)
|
||||||
|
krb5_err(context, 1, ret, "kadm5_init_with_password");
|
||||||
if (argc != 0)
|
if (argc != 0)
|
||||||
exit(sl_command(commands, argc, argv));
|
exit(sl_command(commands, argc, argv));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user