From 6f3721ba1811812f8fd8cdf6b42d002bb1750c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 3 Apr 2009 04:00:05 +0000 Subject: [PATCH] remove krb5_cc_next_cred_match, make work git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25022 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/cache.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/lib/krb5/cache.c b/lib/krb5/cache.c index dd7d64373..362e3619d 100644 --- a/lib/krb5/cache.c +++ b/lib/krb5/cache.c @@ -776,32 +776,6 @@ krb5_cc_next_cred (krb5_context context, return (*id->ops->get_next)(context, id, cursor, creds); } -/** - * Like krb5_cc_next_cred, but allow for selective retrieval - * - * @ingroup krb5_ccache - */ - - -krb5_error_code KRB5_LIB_FUNCTION -krb5_cc_next_cred_match(krb5_context context, - const krb5_ccache id, - krb5_cc_cursor * cursor, - krb5_creds * creds, - krb5_flags whichfields, - const krb5_creds * mcreds) -{ - krb5_error_code ret; - while (1) { - ret = krb5_cc_next_cred(context, id, cursor, creds); - if (ret) - return ret; - if (mcreds == NULL || krb5_compare_creds(context, whichfields, mcreds, creds)) - return 0; - krb5_free_cred_contents(context, creds); - } -} - /** * Destroy the cursor `cursor'. * @@ -907,9 +881,7 @@ krb5_cc_copy_match_f(krb5_context context, return ret; } - while ((ret = krb5_cc_next_cred(context, from, cursor, &cred)) == 0) { - if (ret) - break; + while ((ret = krb5_cc_next_cred(context, from, &cursor, &cred)) == 0) { if (match == NULL || (*match)(context, matchctx, &cred) == 0) { if (matched) (*matched)++; @@ -921,6 +893,8 @@ krb5_cc_copy_match_f(krb5_context context, } krb5_cc_end_seq_get(context, from, &cursor); krb5_free_principal(context, princ); + if (ret == KRB5_CC_END) + ret = 0; return ret; }