From 671be173adfc55d61373558b21f2c8324fc97355 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 8 Apr 2011 17:45:07 +0000 Subject: [PATCH] Correctly recognize non-iterable keytabs in k5_kt_get_principal() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24860 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/ktfns.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/keytab/ktfns.c b/src/lib/krb5/keytab/ktfns.c index 53d0b8364..ecf0acfc5 100644 --- a/src/lib/krb5/keytab/ktfns.c +++ b/src/lib/krb5/keytab/ktfns.c @@ -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) -- 2.26.2