From 4bdf914cba2a63d186138d1341a7260ad79da1f5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 6 Jul 2004 23:42:58 +0000 Subject: r1373: Fix from Guenther Deschner to ensure last error return is not invalid. Jeremy. --- source/libads/kerberos_keytab.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/libads/kerberos_keytab.c b/source/libads/kerberos_keytab.c index 95152016b85..eec5f104fd9 100644 --- a/source/libads/kerberos_keytab.c +++ b/source/libads/kerberos_keytab.c @@ -479,7 +479,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads) ret = krb5_kt_start_seq_get(context, keytab, &cursor); if (ret != KRB5_KT_END && ret != ENOENT ) { - while ((ret = krb5_kt_next_entry(context, keytab, &kt_entry, &cursor)) == 0) { + while (krb5_kt_next_entry(context, keytab, &kt_entry, &cursor) == 0) { if (kt_entry.vno != kvno) { char *ktprinc = NULL; char *p; @@ -516,6 +516,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads) smb_krb5_kt_free_entry(context, &kt_entry); ZERO_STRUCT(kt_entry); } + ret = 0; for (i = 0; oldEntries[i]; i++) { ret |= ads_keytab_add_entry(ads, oldEntries[i]); krb5_free_unparsed_name(context, oldEntries[i]); -- cgit