summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_dual.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-11 14:44:10 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-11 14:44:10 +0200
commit6a78e56277799672b7ac187c57e546836e136f79 (patch)
tree87f0336cb1908d01690b74c56a44f4713559b5bc /source3/winbindd/winbindd_dual.c
parentddbddbd80c80b872cdd36a01f9a3a6bc2eca1b1f (diff)
parentf0a27064869871806343648de3b5a0667118872f (diff)
downloadsamba-6a78e56277799672b7ac187c57e546836e136f79.tar.gz
samba-6a78e56277799672b7ac187c57e546836e136f79.tar.bz2
samba-6a78e56277799672b7ac187c57e546836e136f79.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into arc4
Diffstat (limited to 'source3/winbindd/winbindd_dual.c')
-rw-r--r--source3/winbindd/winbindd_dual.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 1600f05eb1..aeb52d9b5a 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -120,6 +120,10 @@ void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
SMB_ASSERT(continuation != NULL);
+ DEBUG(10, ("Sending request to child pid %d (domain=%s)\n",
+ (int)child->pid,
+ (child->domain != NULL) ? child->domain->name : "''"));
+
state = TALLOC_P(mem_ctx, struct winbindd_async_request);
if (state == NULL) {
@@ -296,6 +300,18 @@ static void schedule_async_request(struct winbindd_child *child)
return; /* Busy */
}
+ /*
+ * This may be a reschedule, so we might
+ * have an existing timeout event pending on
+ * the first entry in the child->requests list
+ * (we only send one request at a time).
+ * Ensure we free it before we reschedule.
+ * Bug #5814, from hargagan <shargagan@novell.com>.
+ * JRA.
+ */
+
+ TALLOC_FREE(request->reply_timeout_event);
+
if ((child->pid == 0) && (!fork_domain_child(child))) {
/* fork_domain_child failed.
Cancel all outstanding requests */
@@ -491,6 +507,17 @@ void winbind_child_died(pid_t pid)
child->event.flags = 0;
child->pid = 0;
+ if (child->requests) {
+ /*
+ * schedule_async_request() will also
+ * clear this event but the call is
+ * idempotent so it doesn't hurt to
+ * cover all possible future code
+ * paths. JRA.
+ */
+ TALLOC_FREE(child->requests->reply_timeout_event);
+ }
+
schedule_async_request(child);
}