Correctly recognize non-iterable keytabs in k5_kt_get_principal()
authorGreg Hudson <ghudson@mit.edu>
Fri, 8 Apr 2011 17:45:07 +0000 (17:45 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 8 Apr 2011 17:45:07 +0000 (17:45 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24860 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/ktfns.c

index 53d0b8364805860d861993d1bb08ae5a48651299..ecf0acfc5d7b8eb174fecac067984a789445f164 100644 (file)
@@ -118,9 +118,11 @@ k5_kt_get_principal(krb5_context context, krb5_keytab keytab,
     krb5_keytab_entry kte;
 
     *princ_out = NULL;
+    if (keytab->ops->start_seq_get == NULL)
+        return KRB5_KT_NOTFOUND;
     ret = krb5_kt_start_seq_get(context, keytab, &cursor);
     if (ret)
-        return KRB5_KT_NOTFOUND;
+        return ret;
     ret = krb5_kt_next_entry(context, keytab, &kte, &cursor);
     (void)krb5_kt_end_seq_get(context, keytab, &cursor);
     if (ret)