[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-3348-ge0b7092

Jeremy Allison jra at samba.org
Sun Jan 11 04:03:07 GMT 2009


The branch, v3-2-test has been updated
       via  e0b70923298a0f33d92b9a2901098328d914ab1e (commit)
      from  80a37595ef5c289fcc02a8902e18eb9ab289b28c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit e0b70923298a0f33d92b9a2901098328d914ab1e
Author: Jeremy Allison <jra at samba.org>
Date:   Sat Jan 10 20:02:09 2009 -0800

    Fix logic bug introduce in backport of ccache_regain_all_now, sync with
    3.3 implementation.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/winbindd/winbindd_cred_cache.c |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd_cred_cache.c b/source/winbindd/winbindd_cred_cache.c
index 05294a9..b867641 100644
--- a/source/winbindd/winbindd_cred_cache.c
+++ b/source/winbindd/winbindd_cred_cache.c
@@ -99,25 +99,32 @@ void ccache_regain_all_now(void)
 	struct WINBINDD_CCACHE_ENTRY *cur;
 	struct timeval t = timeval_current();
 
-	cur = ccache_list;
-	while (cur) {
-		TALLOC_FREE(cur->event);
-		if (cur->refresh_time) {
-			cur->event = event_add_timed(winbind_event_context(),
-						     cur, t,
-						     "krb5_ticket_refresh_handler",
-						     krb5_ticket_refresh_handler,
-						     cur);
-		} else {
-			cur->event = event_add_timed(winbind_event_context(),
+	for (cur = ccache_list; cur; cur = cur->next) {
+		struct timed_event *new_event;
+
+		/*
+		 * if refresh_time is 0, we know that the
+		 * the event has the krb5_ticket_gain_handler
+		 */
+		if (cur->refresh_time == 0) {
+			new_event = event_add_timed(winbind_event_context(),
 						      cur, t,
 						      "krb5_ticket_gain_handler",
 						      krb5_ticket_gain_handler,
 						      cur);
+		} else {
+			new_event = event_add_timed(winbind_event_context(),
+						     cur, t,
+						     "krb5_ticket_refresh_handler",
+						     krb5_ticket_refresh_handler,
+						     cur);
 		}
-		if (!cur->event) {
-			DEBUG(0,("ccache_regain_all_now: out of memory!!\n"));
+		if (!new_event) {
+			continue;
 		}
+
+		TALLOC_FREE(cur->event);
+		cur->event = new_event;
 	}
 	return;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list