summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-13 13:55:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:51:43 -0500
commitc9f9917e77ac780594c3dff476c33f521bbef2bd (patch)
tree980df481fe4149fd9e830221336bfb5e5e7aa165
parent8be112a81bf7d7fb48ee82fd38c1f8d0f85bbc75 (diff)
downloadsamba-c9f9917e77ac780594c3dff476c33f521bbef2bd.tar.gz
samba-c9f9917e77ac780594c3dff476c33f521bbef2bd.tar.bz2
samba-c9f9917e77ac780594c3dff476c33f521bbef2bd.zip
r18473: Once we go online, trigger a "get krb5 ticket event"
immediately if we were waiting on one. Jeremy. (This used to be commit 6dc8f9042f057e1f9aff46042a0fe697cb8a912c)
-rw-r--r--source3/lib/events.c17
-rw-r--r--source3/nsswitch/winbindd_cm.c6
2 files changed, 22 insertions, 1 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 7da44c3466..d6f3c32828 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -58,7 +58,8 @@ struct timed_event *add_timed_event(TALLOC_CTX *mem_ctx,
te->handler = handler;
te->private_data = private_data;
- /* keep the list ordered */
+ /* keep the list ordered - this is NOT guarenteed as event times
+ may be changed after insertion */
last_te = NULL;
for (cur_te = timed_events; cur_te; cur_te = cur_te->next) {
/* if the new event comes before the current one break */
@@ -115,3 +116,17 @@ struct timeval *get_timed_events_timeout(struct timeval *to_ret)
return to_ret;
}
+
+int set_event_dispatch_time(const char *event_name, struct timeval when)
+{
+ int num_events = 0;
+ struct timed_event *te;
+
+ for (te = timed_events; te; te = te->next) {
+ if (strcmp(event_name, te->event_name) == 0) {
+ te->when = when;
+ num_events++;
+ }
+ }
+ return num_events;
+}
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index ff2567d3e5..a0d97f2ff6 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -146,6 +146,8 @@ void set_domain_offline(struct winbindd_domain *domain)
void set_domain_online(struct winbindd_domain *domain)
{
+ struct timeval now;
+
DEBUG(10,("set_domain_online: called for domain %s\n",
domain->name ));
@@ -155,6 +157,10 @@ void set_domain_online(struct winbindd_domain *domain)
return;
}
+ /* If we are waiting to get a krb5 ticket, trigger immediately. */
+ GetTimeOfDay(&now);
+ set_event_dispatch_time("krb5_ticket_gain_handler", now);
+
domain->online = True;
}