add get_name callback for kdb keytab type, for debugging
authorKen Raeburn <raeburn@mit.edu>
Sat, 13 Dec 2003 06:35:15 +0000 (06:35 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 13 Dec 2003 06:35:15 +0000 (06:35 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15910 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/ChangeLog
src/lib/kdb/keytab.c

index 87f60aad919f05adfda608b6449d1441d0cc6802..49ae47865c3938febb9205a4eb640a64a715870a 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-13  Ken Raeburn  <raeburn@mit.edu>
+
+       * keytab.c (krb5_ktkdb_get_name): New function.
+       (krb5_kt_kdb_ops): Add pointer to it.
+
 2003-05-22  Ezra Peisach  <epeisach@mit.edu>
 
        * keytab.c (is_xrealm_tgt): Use strncmp instead of strcmp - as
index 5db382cc25c686ab522a15718cdc9d74f9b502b9..4d5894d088cf7282b2f62848079bcc8241965107 100644 (file)
@@ -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 */