s3: Properly deal with exited winbind children
authorVolker Lendecke <vl@samba.org>
Wed, 4 May 2011 10:11:04 +0000 (12:11 +0200)
committerVolker Lendecke <vlendec@samba.org>
Wed, 4 May 2011 11:32:16 +0000 (13:32 +0200)
When a winbind child exits, we need to immediately close the socket. If not,
the next request to that child will be sent to a socket without a listener,
leading to a failed request. This failed request will then trigger a proper
re-init.

This patch avoids the one failed request.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed May  4 13:32:16 CEST 2011 on sn-devel-104

source3/winbindd/winbindd_dual.c

index 088353d10f1ecb8b26fcac83472b6df472334481..1078f8d374d32f734740b8eadc8071164a3fae4e 100644 (file)
@@ -510,6 +510,11 @@ void winbind_child_died(pid_t pid)
 
        DLIST_REMOVE(winbindd_children, child);
        child->pid = 0;
+
+       if (child->sock != -1) {
+               close(child->sock);
+               child->sock = -1;
+       }
 }
 
 /* Ensure any negative cache entries with the netbios or realm names are removed. */