From fdf31b235367b03333258af5e524c36fbd1eee64 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 13 Dec 2003 06:35:15 +0000 Subject: [PATCH] add get_name callback for kdb keytab type, for debugging git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15910 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/ChangeLog | 5 +++++ src/lib/kdb/keytab.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 87f60aad9..49ae47865 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,8 @@ +2003-12-13 Ken Raeburn + + * keytab.c (krb5_ktkdb_get_name): New function. + (krb5_kt_kdb_ops): Add pointer to it. + 2003-05-22 Ezra Peisach * keytab.c (is_xrealm_tgt): Use strncmp instead of strcmp - as diff --git a/src/lib/kdb/keytab.c b/src/lib/kdb/keytab.c index 5db382cc2..4d5894d08 100644 --- a/src/lib/kdb/keytab.c +++ b/src/lib/kdb/keytab.c @@ -37,11 +37,21 @@ krb5_error_code krb5_ktkdb_close (krb5_context, krb5_keytab); krb5_error_code krb5_ktkdb_get_entry (krb5_context, krb5_keytab, krb5_const_principal, krb5_kvno, krb5_enctype, krb5_keytab_entry *); +static krb5_error_code +krb5_ktkdb_get_name(krb5_context context, krb5_keytab keytab, + char *name, unsigned int namelen) +{ + if (namelen < sizeof("KDB:")) + return KRB5_KT_NAME_TOOLONG; + strcpy(name, "KDB:"); + return 0; +} + krb5_kt_ops krb5_kt_kdb_ops = { 0, "KDB", /* Prefix -- this string should not appear anywhere else! */ krb5_ktkdb_resolve, /* resolve */ - NULL, /* get_name */ + krb5_ktkdb_get_name, /* get_name */ krb5_ktkdb_close, /* close */ krb5_ktkdb_get_entry, /* get */ NULL, /* start_seq_get */ -- 2.26.2