summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5/keytab.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/krb5/keytab.c')
-rw-r--r--source4/heimdal/lib/krb5/keytab.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/heimdal/lib/krb5/keytab.c b/source4/heimdal/lib/krb5/keytab.c
index 43fc21c1d1..f6c7858c12 100644
--- a/source4/heimdal/lib/krb5/keytab.c
+++ b/source4/heimdal/lib/krb5/keytab.c
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: keytab.c,v 1.63 2005/11/25 21:46:40 lha Exp $");
+RCSID("$Id: keytab.c 20211 2007-02-09 07:11:03Z lha $");
/*
* Register a new keytab in `ops'
@@ -364,11 +364,11 @@ krb5_kt_get_entry(krb5_context context,
if (entry->vno) {
return 0;
} else {
- char princ[256], kt_name[256], kvno_str[25];
+ char princ[256], kvno_str[25], *kt_name;
char *enctype_str = NULL;
krb5_unparse_name_fixed (context, principal, princ, sizeof(princ));
- krb5_kt_get_name (context, id, kt_name, sizeof(kt_name));
+ krb5_kt_get_full_name (context, id, &kt_name);
krb5_enctype_to_string(context, enctype, &enctype_str);
if (kvno)
@@ -377,11 +377,12 @@ krb5_kt_get_entry(krb5_context context,
kvno_str[0] = '\0';
krb5_set_error_string (context,
- "failed to find %s%s in keytab %s (%s)",
+ "Failed to find %s%s in keytab %s (%s)",
princ,
kvno_str,
- kt_name,
+ kt_name ? kt_name : "unknown keytab",
enctype_str ? enctype_str : "unknown enctype");
+ free(kt_name);
free(enctype_str);
return KRB5_KT_NOTFOUND;
}