Add `-l' flag to use local database.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3951 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -43,6 +43,7 @@ RCSID("$Id$");
|
|||||||
|
|
||||||
static char *config_file;
|
static char *config_file;
|
||||||
static char *keyfile;
|
static char *keyfile;
|
||||||
|
static int local_flag;
|
||||||
static int help_flag;
|
static int help_flag;
|
||||||
static int version_flag;
|
static int version_flag;
|
||||||
static char *realm;
|
static char *realm;
|
||||||
@@ -65,6 +66,7 @@ static struct getargs args[] = {
|
|||||||
"admin-server", 'a', arg_string, &admin_server,
|
"admin-server", 'a', arg_string, &admin_server,
|
||||||
"server to contact", "host"
|
"server to contact", "host"
|
||||||
},
|
},
|
||||||
|
{ "local", 'l', arg_flag, &local_flag, "local admin mode" },
|
||||||
{ "help", 'h', arg_flag, &help_flag },
|
{ "help", 'h', arg_flag, &help_flag },
|
||||||
{ "version", 'v', arg_flag, &version_flag }
|
{ "version", 'v', arg_flag, &version_flag }
|
||||||
};
|
};
|
||||||
@@ -172,14 +174,22 @@ main(int argc, char **argv)
|
|||||||
conf.admin_server = admin_server;
|
conf.admin_server = admin_server;
|
||||||
conf.mask |= KADM5_CONFIG_ADMIN_SERVER;
|
conf.mask |= KADM5_CONFIG_ADMIN_SERVER;
|
||||||
|
|
||||||
ret = kadm5_init_with_password_ctx(context,
|
if(local_flag)
|
||||||
/* XXX these are not used */
|
ret = kadm5_s_init_with_password_ctx(context,
|
||||||
"client",
|
KADM5_ADMIN_SERVICE,
|
||||||
"password",
|
"password",
|
||||||
"service",
|
KADM5_ADMIN_SERVICE,
|
||||||
&conf, 0, 0,
|
&conf, 0, 0,
|
||||||
&kadm_handle);
|
&kadm_handle);
|
||||||
|
else
|
||||||
|
ret = kadm5_c_init_with_password_ctx(context,
|
||||||
|
/* XXX these are not used */
|
||||||
|
"client",
|
||||||
|
"password",
|
||||||
|
KADM5_ADMIN_SERVICE,
|
||||||
|
&conf, 0, 0,
|
||||||
|
&kadm_handle);
|
||||||
|
|
||||||
if(ret)
|
if(ret)
|
||||||
krb5_err(context, 1, ret, "kadm5_init_with_password");
|
krb5_err(context, 1, ret, "kadm5_init_with_password");
|
||||||
if (argc != 0)
|
if (argc != 0)
|
||||||
|
Reference in New Issue
Block a user