Don't skip keytab entries with kvno=0
authorRichard Basch <probe@mit.edu>
Thu, 9 May 1996 15:57:58 +0000 (15:57 +0000)
committerRichard Basch <probe@mit.edu>
Thu, 9 May 1996 15:57:58 +0000 (15:57 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7949 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/file/ChangeLog
src/lib/krb5/keytab/file/ktf_g_ent.c

index 385e254c898478b02905214947fd3548c28cfc1b..3957f037f338a73697044dd57c895440b6828841 100644 (file)
@@ -1,3 +1,8 @@
+Thu May  9 03:05:51 1996  Richard Basch  <basch@lehman.com>
+
+       * ktf_g_ent.c (krb5_ktfile_get_entry): don't skip over keytab
+               entries with kvno=0.
+
 Tue Mar 19 22:28:43 1996  Richard Basch  <basch@lehman.com>
 
        * ktf_g_ent.c (krb5_ktfile_get_entry): all des enctypes are equivalent
index 9a76ce4cdae3bbddc54526059a41109c34932fa5..4805d5c6970e1d8ef8b75041dee14cdc1c85ec59 100644 (file)
@@ -81,16 +81,17 @@ krb5_ktfile_get_entry(context, id, principal, kvno, enctype, entry)
            (entry_type == enctype))&&
            krb5_principal_compare(context, principal, new_entry.principal)) {
                if (kvno == IGNORE_VNO) {
-                       if (cur_entry.vno < new_entry.vno) {
+                       if (! cur_entry.principal ||
+                           (cur_entry.vno < new_entry.vno))
+                       {
                            krb5_kt_free_entry(context, &cur_entry);
-                               cur_entry = new_entry;
+                           cur_entry = new_entry;
                        }
                } else {
                        if (new_entry.vno == kvno) {
-krb5_kt_free_entry(context, &cur_entry);
-
-                               cur_entry = new_entry;
-                               break;
+                           krb5_kt_free_entry(context, &cur_entry);
+                           cur_entry = new_entry;
+                           break;
                        }
                }
        } else {