Bug 1797 - nmbd and winbind ignores --log-basename=... option.
Summary: nmbd and winbind ignores --log-basename=... option.
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: nmbd (show other bugs)
Version: 3.0.7
Hardware: All All
: P3 minor
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-19 14:11 UTC by Igor Zhbanov
Modified: 2005-08-24 10:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Zhbanov 2004-09-19 14:11:26 UTC
Both nmbd and winbind ignores --log-basename=... option and writes log files to
directory which was hardcoded at a compile time.
This is because they incorrectly assign log file name again (after command-line
parsing). Here is a patch:

diff -ur samba-3.0.6/source/nmbd/nmbd.c samba/source/nmbd/nmbd.c
--- samba-3.0.6/source/nmbd/nmbd.c	2004-04-04 11:37:37.000000000 +0400
+++ samba/source/nmbd/nmbd.c	2004-09-19 23:25:28.000000000 +0400
@@ -29,6 +29,8 @@
 
 extern BOOL global_in_nmbd;
 
+extern BOOL override_logfile;
+
 /* are we running as a daemon ? */
 static BOOL is_daemon;
 
@@ -623,8 +625,10 @@
 	
 	sys_srandom(time(NULL) ^ sys_getpid());
 	
-	slprintf(logfile, sizeof(logfile)-1, "%s/log.nmbd", dyn_LOGFILEBASE);
-	lp_set_logfile(logfile);
+	if (!override_logfile) {
+		slprintf(logfile, sizeof(logfile)-1, "%s/log.nmbd", dyn_LOGFILEBASE);
+		lp_set_logfile(logfile);
+	}
 	
 	fault_setup((void (*)(void *))fault_continue );
 	
diff -ur samba-3.0.6/source/nsswitch/winbindd.c samba/source/nsswitch/winbindd.c
--- samba-3.0.6/source/nsswitch/winbindd.c	2004-08-07 01:38:19.000000000 +0400
+++ samba/source/nsswitch/winbindd.c	2004-09-19 23:30:40.000000000 +0400
@@ -28,6 +28,8 @@
 BOOL opt_nocache = False;
 BOOL opt_dual_daemon = True;
 
+extern BOOL override_logfile;
+
 /* Reload configuration */
 
 static BOOL reload_services_file(void)
@@ -846,8 +848,10 @@
 		exit(1);
 	}
 
-	pstr_sprintf(logfile, "%s/log.winbindd", dyn_LOGFILEBASE);
-	lp_set_logfile(logfile);
+	if (!override_logfile) {
+		pstr_sprintf(logfile, "%s/log.winbindd", dyn_LOGFILEBASE);
+		lp_set_logfile(logfile);
+	}
 	setup_logging("winbindd", log_stdout);
 	reopen_logs();
Comment 1 Volker Lendecke 2004-09-21 02:07:53 UTC
Patch applied. Thanks!

Volker
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:24:08 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.