summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_dual.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-06 17:34:06 -0800
committerJeremy Allison <jra@samba.org>2009-01-06 17:34:06 -0800
commitd1f7a3717406de855169e88ebc5a9da2318c99ef (patch)
tree3785a001f9d6eb0ea3defa7fa815410f344cef19 /source3/winbindd/winbindd_dual.c
parente13983870f00f83420cca554a541165214dc4e06 (diff)
downloadsamba-d1f7a3717406de855169e88ebc5a9da2318c99ef.tar.gz
samba-d1f7a3717406de855169e88ebc5a9da2318c99ef.tar.bz2
samba-d1f7a3717406de855169e88ebc5a9da2318c99ef.zip
Make winbindd_cm.c use winbindd_reinit_after_fork().
Jeremy.
Diffstat (limited to 'source3/winbindd/winbindd_dual.c')
-rw-r--r--source3/winbindd/winbindd_dual.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index d2c085a9d1..c1b1efb9f2 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1142,7 +1142,7 @@ static void child_msg_dump_event_list(struct messaging_context *msg,
dump_event_list(winbind_event_context());
}
-static void winbindd_reinit_after_fork(struct winbindd_child *child)
+bool winbindd_reinit_after_fork(const char *logfilename)
{
struct winbindd_domain *domain;
struct winbindd_child *cl;
@@ -1150,13 +1150,13 @@ static void winbindd_reinit_after_fork(struct winbindd_child *child)
if (!reinit_after_fork(winbind_messaging_context(),
winbind_event_context(), true)) {
DEBUG(0,("reinit_after_fork() failed\n"));
- _exit(0);
+ return false;
}
close_conns_after_fork();
- if (!override_logfile) {
- lp_set_logfile(child->logfilename);
+ if (!override_logfile && logfilename) {
+ lp_set_logfile(logfilename);
reopen_logs();
}
@@ -1178,18 +1178,6 @@ static void winbindd_reinit_after_fork(struct winbindd_child *child)
messaging_deregister(winbind_messaging_context(),
MSG_DEBUG, NULL);
- /* Handle online/offline messages. */
- messaging_register(winbind_messaging_context(), NULL,
- MSG_WINBIND_OFFLINE, child_msg_offline);
- messaging_register(winbind_messaging_context(), NULL,
- MSG_WINBIND_ONLINE, child_msg_online);
- messaging_register(winbind_messaging_context(), NULL,
- MSG_WINBIND_ONLINESTATUS, child_msg_onlinestatus);
- messaging_register(winbind_messaging_context(), NULL,
- MSG_DUMP_EVENT_LIST, child_msg_dump_event_list);
- messaging_register(winbind_messaging_context(), NULL,
- MSG_DEBUG, debug_message);
-
/* We have destroyed all events in the winbindd_event_context
* in reinit_after_fork(), so clean out all possible pending
* event pointers. */
@@ -1215,6 +1203,8 @@ static void winbindd_reinit_after_fork(struct winbindd_child *child)
TALLOC_FREE(cl->lockout_policy_event);
TALLOC_FREE(cl->machine_password_change_event);
}
+
+ return true;
}
static bool fork_domain_child(struct winbindd_child *child)
@@ -1268,7 +1258,21 @@ static bool fork_domain_child(struct winbindd_child *child)
state.sock = fdpair[0];
close(fdpair[1]);
- winbindd_reinit_after_fork(child);
+ if (!winbindd_reinit_after_fork(child->logfilename)) {
+ _exit(0);
+ }
+
+ /* Handle online/offline messages. */
+ messaging_register(winbind_messaging_context(), NULL,
+ MSG_WINBIND_OFFLINE, child_msg_offline);
+ messaging_register(winbind_messaging_context(), NULL,
+ MSG_WINBIND_ONLINE, child_msg_online);
+ messaging_register(winbind_messaging_context(), NULL,
+ MSG_WINBIND_ONLINESTATUS, child_msg_onlinestatus);
+ messaging_register(winbind_messaging_context(), NULL,
+ MSG_DUMP_EVENT_LIST, child_msg_dump_event_list);
+ messaging_register(winbind_messaging_context(), NULL,
+ MSG_DEBUG, debug_message);
primary_domain = find_our_domain();