diff options
author | Greg Hudson <ghudson@mit.edu> | 2010-06-08 18:18:03 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2010-06-08 18:18:03 +0000 |
commit | e948df8c7ba8174337437b47dd2de2c14e98e19f (patch) | |
tree | 685b6c38be48bce8d54986dec61b33ee8abb55fd /src | |
parent | 27388a63d966366d9265ee96898c44e975c57c6c (diff) | |
download | krb5-e948df8c7ba8174337437b47dd2de2c14e98e19f.zip krb5-e948df8c7ba8174337437b47dd2de2c14e98e19f.tar.gz krb5-e948df8c7ba8174337437b47dd2de2c14e98e19f.tar.bz2 |
kadmin ktadd may display wrong name of default keytab
kadmin's ktadd (and ktrem) displays WRFILE:/etc/krb5.keytab whenever
it uses the default keytab, even if the default has been overridden
(e.g. by KRB5_KTNAME). Use krb5_kt_get_name to get the correct name
of the default cache instead of displaying the string we think was
used to open it.
ticket: 6740
target_version: 1.8.2
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24123 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/kadmin/cli/kadmin.h | 1 | ||||
-rw-r--r-- | src/kadmin/cli/keytab.c | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/kadmin/cli/kadmin.h b/src/kadmin/cli/kadmin.h index 5c9decc..9f657a6 100644 --- a/src/kadmin/cli/kadmin.h +++ b/src/kadmin/cli/kadmin.h @@ -68,7 +68,6 @@ extern time_t get_date(char *); /* Yucky global variables */ extern krb5_context context; -extern char *krb5_defkeyname; extern char *whoami; extern void *handle; diff --git a/src/kadmin/cli/keytab.c b/src/kadmin/cli/keytab.c index 8b29110..3a7867f 100644 --- a/src/kadmin/cli/keytab.c +++ b/src/kadmin/cli/keytab.c @@ -84,9 +84,7 @@ process_keytab(krb5_context my_context, char **keytab_str, char *name = *keytab_str; if (name == NULL) { - /* XXX krb5_defkeyname is an internal library global and - should go away */ - name = strdup(krb5_defkeyname); + name = malloc(BUFSIZ); if (!name) { com_err(whoami, ENOMEM, "while creating keytab name"); return 1; @@ -97,6 +95,12 @@ process_keytab(krb5_context my_context, char **keytab_str, free(name); return 1; } + code = krb5_kt_get_name(my_context, *keytab, name, BUFSIZ); + if (code != 0) { + com_err(whoami, code, "while getting keytab name"); + free(name); + return 1; + } } else { if (strchr(name, ':') != NULL) name = strdup(name); |