diff options
author | Bo Yang <boyang@novell.com> | 2009-01-06 12:49:59 +0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-01-05 21:09:44 -0800 |
commit | 958bfaff7908509dc0c171e080e5767453dea4a3 (patch) | |
tree | 85e81c0e4c1d3aa37fd610e68c5a69c44849820b | |
parent | d2c70d24e12293d9b4272eb310a6a4c4582b2d92 (diff) | |
download | samba-958bfaff7908509dc0c171e080e5767453dea4a3.tar.gz samba-958bfaff7908509dc0c171e080e5767453dea4a3.tar.bz2 samba-958bfaff7908509dc0c171e080e5767453dea4a3.zip |
set entry->refresh_time to make ccache_regain_all_now() work correctly.
-rw-r--r-- | source3/winbindd/winbindd_cred_cache.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c index 900f9acdfa..a922a04894 100644 --- a/source3/winbindd/winbindd_cred_cache.c +++ b/source3/winbindd/winbindd_cred_cache.c @@ -148,7 +148,8 @@ rekinit: /* Don't break the ticket refresh chain: retry * refreshing ticket sometime later when KDC is - * unreachable -- BoYang + * unreachable -- BoYang. More error code handling + * here? * */ if ((ret == KRB5_KDC_UNREACH) @@ -159,6 +160,7 @@ rekinit: new_start = time(NULL) + MAX(30, lp_winbind_cache_time()); #endif + entry->refresh_time = 0; /* try to regain ticket here */ entry->event = event_add_timed(winbind_event_context(), entry, @@ -226,7 +228,8 @@ rekinit: /* avoid breaking the renewal chain: retry in * lp_winbind_cache_time() seconds when the KDC was not * available right now. - * the return code can be KRB5_REALM_CANT_RESOLVE*/ + * the return code can be KRB5_REALM_CANT_RESOLVE. + * More error code handling here? */ if ((ret == KRB5_KDC_UNREACH) || (ret == KRB5_REALM_CANT_RESOLVE)) { @@ -238,6 +241,7 @@ rekinit: #endif /* ticket is destroyed here, we have to regain it * if it is possible */ + entry->refresh_time = 0; entry->event = event_add_timed(winbind_event_context(), entry, timeval_set(new_start, 0), @@ -271,6 +275,7 @@ done: && (entry->renew_until <= expire_time)) { /* try to regain ticket 10 seconds beforre expiration */ expire_time -= 10; + entry->refresh_time = 0; entry->event = event_add_timed(winbind_event_context(), entry, timeval_set(expire_time, 0), krb5_ticket_gain_handler, @@ -545,6 +550,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name, if (!entry->event) { if (postponed_request) { t = timeval_current_ofs(MAX(30, lp_winbind_cache_time()), 0); + entry->refresh_time = 0; entry->event = event_add_timed(winbind_event_context(), entry, t, @@ -557,6 +563,9 @@ NTSTATUS add_ccache_to_list(const char *princ_name, #else t = timeval_set(KRB5_EVENT_REFRESH_TIME(ticket_end), 0); #endif + if (!entry->refresh_time) { + entry->refresh_time = t.tv_sec; + } entry->event = event_add_timed(winbind_event_context(), entry, t, |