diff options
author | Assar Westerlund <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
---|---|---|
committer | Assar Westerlund <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
commit | adb0ddaeac0a71a08d6af3a711387b59efcc94b6 (patch) | |
tree | ed28ffb73cc0ae48a9892dab3f10b09bc36436d5 /crypto/heimdal/kadmin/kadmin.c | |
parent | 45524cd79e498d0465de59a4c8c825709b2662df (diff) | |
download | src-adb0ddaeac0a71a08d6af3a711387b59efcc94b6.tar.gz src-adb0ddaeac0a71a08d6af3a711387b59efcc94b6.zip |
import of heimdal 0.3f
Notes
Notes:
svn path=/vendor-crypto/heimdal/dist/; revision=78527
Diffstat (limited to 'crypto/heimdal/kadmin/kadmin.c')
-rw-r--r-- | crypto/heimdal/kadmin/kadmin.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/crypto/heimdal/kadmin/kadmin.c b/crypto/heimdal/kadmin/kadmin.c index 5a21ffb31d6a..058187cb1f93 100644 --- a/crypto/heimdal/kadmin/kadmin.c +++ b/crypto/heimdal/kadmin/kadmin.c @@ -34,7 +34,7 @@ #include "kadmin_locl.h" #include <sl.h> -RCSID("$Id: kadmin.c,v 1.34 2001/01/26 22:20:52 joda Exp $"); +RCSID("$Id: kadmin.c,v 1.38 2001/05/15 06:34:35 assar Exp $"); static char *config_file; static char *keyfile; @@ -45,10 +45,13 @@ static char *realm; static char *admin_server; static int server_port = 0; static char *client_name; +static char *keytab; static struct getargs args[] = { { "principal", 'p', arg_string, &client_name, "principal to authenticate as" }, + { "keytab", 'K', arg_string, &keytab, + "keytab for authentication pricipal" }, { "config-file", 'c', arg_string, &config_file, "location of config file", "file" @@ -222,7 +225,7 @@ main(int argc, char **argv) int optind = 0; int e; - set_progname(argv[0]); + setprogname(argv[0]); ret = krb5_init_context(&context); if (ret) @@ -245,12 +248,13 @@ main(int argc, char **argv) if (config_file == NULL) config_file = HDB_DB_DIR "/kdc.conf"; - if(krb5_config_parse_file(config_file, &cf) == 0) { + if(krb5_config_parse_file(context, config_file, &cf) == 0) { const char *p = krb5_config_get_string (context, cf, "kdc", "key-file", NULL); if (p) keyfile = strdup(p); } + krb5_clear_error_string (context); memset(&conf, 0, sizeof(conf)); if(realm) { @@ -278,6 +282,14 @@ main(int argc, char **argv) &conf, 0, 0, &kadm_handle); actual_cmds = commands; + } else if (keytab) { + ret = kadm5_c_init_with_skey_ctx(context, + client_name, + keytab, + KADM5_ADMIN_SERVICE, + &conf, 0, 0, + &kadm_handle); + actual_cmds = commands + 4; /* XXX */ } else { ret = kadm5_c_init_with_password_ctx(context, client_name, |