DEBUG(0,("async_request_timeout_handler: child pid %u is not responding. "
"Closing connection to it.\n",
- state->child_pid ));
+ (unsigned int)state->child_pid ));
/* Deal with the reply - set to error. */
async_reply_recv(private_data, False);
struct winbindd_domain *domain;
struct winbindd_child *cl;
- if (!reinit_after_fork(winbind_messaging_context(),
- winbind_event_context(), true)) {
+ if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
+ winbind_event_context(),
+ true))) {
DEBUG(0,("reinit_after_fork() failed\n"));
return false;
}
logfilename))
return false;
+ /* Stop zombies in children */
+ CatchChild();
+
/* Don't handle the same messages as our parent. */
messaging_deregister(winbind_messaging_context(),
MSG_SMB_CONF_UPDATED, NULL);
DEBUG(10, ("Child process %d\n", (int)sys_getpid()));
- /* Stop zombies in children */
- CatchChild();
-
state.sock = fdpair[0];
close(fdpair[1]);
}
if (child->domain && child->domain->primary &&
- !lp_use_kerberos_keytab() &&
+ !USE_KERBEROS_KEYTAB &&
lp_server_role() == ROLE_DOMAIN_MEMBER) {
struct timeval next_change;
FD_ZERO(&r_fds);
FD_ZERO(&w_fds);
+
+ if (state.sock < 0 || state.sock >= FD_SETSIZE) {
+ TALLOC_FREE(frame);
+ perror("EBADF");
+ _exit(1);
+ }
+
FD_SET(state.sock, &r_fds);
maxfd = state.sock;
+ /*
+ * Initialize this high as event_add_to_select_args()
+ * uses a timeval_min() on this and next_event. Fix
+ * from Roel van Meer <rolek@alt001.com>.
+ */
+ t.tv_sec = 999999;
+ t.tv_usec = 0;
+
event_add_to_select_args(winbind_event_context(), &now,
&r_fds, &w_fds, &t, &maxfd);
tp = get_timed_events_timeout(winbind_event_context(), &t);