#include "includes.h"
#include "winbindd.h"
#include "nsswitch/wb_reqtrans.h"
-#include "librpc/gen_ndr/messaging.h"
#include "secrets.h"
#include "../lib/util/select.h"
#include "../libcli/security/security.h"
#include "system/select.h"
+#include "messages.h"
+#include "ntdomain.h"
+#include "../lib/util/tevent_unix.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
dump_event_list(winbind_event_context());
}
-bool winbindd_reinit_after_fork(const char *logfilename)
+bool winbindd_reinit_after_fork(const struct winbindd_child *myself,
+ const char *logfilename)
{
struct winbindd_domain *domain;
struct winbindd_child *cl;
* go through the parent.
*/
cl->pid = (pid_t)0;
+
+ /*
+ * Close service sockets to all other children
+ */
+ if ((cl != myself) && (cl->sock != -1)) {
+ close(cl->sock);
+ cl->sock = -1;
+ }
}
/*
* This is a little tricky, children must not
state.sock = fdpair[0];
close(fdpair[1]);
- if (!winbindd_reinit_after_fork(child->logfilename)) {
+ if (!winbindd_reinit_after_fork(child, child->logfilename)) {
_exit(0);
}