summaryrefslogtreecommitdiff
path: root/source/winbindd/winbindd_cm.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-06 17:35:34 -0800
committerKarolin Seeger <kseeger@samba.org>2009-01-08 16:26:20 +0100
commit3634ed69910c86447bde44a163f6ec1e4001b509 (patch)
tree299e9ff5eab8b87652282a639b08b64255699691 /source/winbindd/winbindd_cm.c
parentb7ae32518c7d7f8ba0008a63ebd54bbb992271bd (diff)
downloadsamba-3634ed69910c86447bde44a163f6ec1e4001b509.tar.gz
Make winbindd_cm.c use winbindd_reinit_after_fork().
Jeremy. (cherry picked from commit 77a4a3976af353f517b5193bae9cfbe0f3ad6f4c)
Diffstat (limited to 'source/winbindd/winbindd_cm.c')
-rw-r--r--source/winbindd/winbindd_cm.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index c2b7fdbc593..fa28bfa053f 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/winbindd/winbindd_cm.c
@@ -172,6 +172,7 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain)
int num_dcs = 0;
TALLOC_CTX *mem_ctx = NULL;
pid_t parent_pid = sys_getpid();
+ char *lfile = NULL;
/* Stop zombies */
CatchChild();
@@ -212,9 +213,14 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain)
/* Leave messages blocked - we will never process one. */
- if (!reinit_after_fork(winbind_messaging_context(),
- winbind_event_context(), true)) {
- DEBUG(0,("reinit_after_fork() failed\n"));
+ if (!override_logfile) {
+ if (asprintf(&lfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) == -1) {
+ DEBUG(0, ("fork_child_dc_connect: out of memory.\n"));
+ return false;
+ }
+ }
+
+ if (!winbindd_reinit_after_fork(lfile)) {
messaging_send_buf(winbind_messaging_context(),
pid_to_procid(parent_pid),
MSG_WINBIND_FAILED_TO_GO_ONLINE,
@@ -222,17 +228,7 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain)
strlen(domain->name)+1);
_exit(0);
}
-
- close_conns_after_fork();
-
- if (!override_logfile) {
- char *lfile;
- if (asprintf(&lfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) > 0) {
- lp_set_logfile(lfile);
- SAFE_FREE(lfile);
- reopen_logs();
- }
- }
+ SAFE_FREE(lfile);
mem_ctx = talloc_init("fork_child_dc_connect");
if (!mem_ctx) {