From 9ed10f83d76eba1c4d4ac19842314f24db1c7a65 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 20 Dec 2001 22:27:05 +0000 Subject: Removed global debugf. Replaced with lp_set_logfile(name). Fixed winbindd to finally stop leaving log. file droppings :-). Jeremy. (This used to be commit 0bea6cf79a44f79fa3a4f2c8381e898e79c66509) --- source3/nsswitch/winbindd.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'source3/nsswitch/winbindd.c') diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index c10cd9e2ca..e68708469c 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -23,8 +23,6 @@ #include "winbindd.h" -extern pstring debugf; - /* List of all connected clients */ struct winbindd_cli_state *client_list; @@ -36,6 +34,7 @@ BOOL opt_nocache; static BOOL reload_services_file(BOOL test) { BOOL ret; + pstring logfile; if (lp_loaded()) { pstring fname; @@ -47,9 +46,15 @@ static BOOL reload_services_file(BOOL test) } } + snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE); + lp_set_logfile(logfile); + reopen_logs(); ret = lp_load(dyn_CONFIGFILE,False,False,True); + snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE); + lp_set_logfile(logfile); + reopen_logs(); load_interfaces(); @@ -66,7 +71,7 @@ static BOOL dump_core(void) { char *p; pstring dname; - pstrcpy( dname, debugf ); + pstrcpy( dname, lp_logfile() ); if ((p=strrchr(dname,'/'))) *p=0; pstrcat( dname, "/corefiles" ); @@ -725,6 +730,7 @@ int main(int argc, char **argv) { extern pstring global_myname; extern fstring global_myworkgroup; + pstring logfile; int accept_sock; BOOL interactive = False; int opt, new_debuglevel = -1; @@ -735,7 +741,8 @@ int main(int argc, char **argv) CatchSignal(SIGUSR1, SIG_IGN); fault_setup((void (*)(void *))fault_quit ); - snprintf(debugf, sizeof(debugf), "%s/log.winbindd", dyn_LOGFILEBASE); + snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE); + lp_set_logfile(logfile); /* Initialise for running in non-root mode */ @@ -777,7 +784,8 @@ int main(int argc, char **argv) } } - snprintf(debugf, sizeof(debugf), "%s/log.winbindd", dyn_LOGFILEBASE); + snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE); + lp_set_logfile(logfile); setup_logging("winbindd", interactive); reopen_logs(); -- cgit