RFC: PATCH: client tools option -l|--log-basename not working

Andreas Schneider asn at samba.org
Thu Jun 29 14:03:39 UTC 2017


On Thursday, 29 June 2017 14:14:28 CEST Noel Power via samba-technical wrote:
> Hi,
> 
> I noticed smbclient wasn't logging to file with the '---log-basename'
> option, a log file was created but no log messages reached it,  the log
> output was nowhere to be seen. After some investigation I came up with
> the first patch in the series below (basically it automagically calls
> reopen_logs as setup_logging is already called for you) However upon
> checking some other client tools I found that these similarly weren't
> obeying the '---log-basename' option. The following patches fix the
> issues seen all the s3/utils client tools. I suspect there are more
> client tools (s4 etc) in the same boat. However I wait to deal with
> those (assuming they exist) just to avoid unnecessarily changing alot of
> stuff if the approach here isn't correct or optimal.


Thanks for the patch Noel!

I think in the following hunk you want to remove the lp_set_cmdline() ...

diff --git a/libcli/nbt/tools/nmblookup.c b/libcli/nbt/tools/nmblookup.c
index e5fa57366e6..8a00aee2d2d 100644
--- a/libcli/nbt/tools/nmblookup.c
+++ b/libcli/nbt/tools/nmblookup.c
@@ -327,7 +327,11 @@ int main(int argc, const char *argv[])
 		POPT_COMMON_SAMBA
 		{ 0, 0, 0, 0 }
 	};
-	
+
+	setup_logging( "nmblookup", DEBUG_DEFAULT_STDERR);
+	/* set default debug level to 1 regardless of what smb.conf sets */
+//	lp_set_cmdline("log level", "1");
+


RB+ for the rest ...


-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list