From 6d12861ce13fe4b7d4ec71a401a3a61f44be9081 Mon Sep 17 00:00:00 2001 From: SATOH Fumiyasu Date: Fri, 18 Nov 2011 02:47:50 +0900 Subject: [PATCH] libsmbclient: Call lp_set_cmdline("log level", "0") before smb.conf and make libsmbclient possible to pass the debug level via 'LIBSMBCLIENT_DEBUG_LEVEL' envvar. --- source3/libsmb/libsmb_context.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index 6c20d65..6ab2b02 100644 --- a/source3/libsmb/libsmb_context.c +++ b/source3/libsmb/libsmb_context.c @@ -43,6 +43,7 @@ static void SMBC_module_init(void * punused) { bool conf_loaded = False; + char *debug = NULL; char *home = NULL; TALLOC_CTX *frame = talloc_stackframe(); @@ -54,6 +55,13 @@ SMBC_module_init(void * punused) lp_set_in_client(True); + debug = getenv("LIBSMBCLIENT_DEBUG_LEVEL"); + if (debug) { + lp_set_cmdline("log level", debug); + } else { + lp_set_cmdline("log level", "0"); + } + home = getenv("HOME"); if (home) { char *conf = NULL; -- 1.7.7.2