summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/client/client.c2
-rw-r--r--source3/lib/debug.c3
-rw-r--r--source3/utils/nmblookup.c5
-rw-r--r--source3/utils/pdbedit.c4
-rw-r--r--source3/utils/smbcontrol.c5
-rw-r--r--source3/utils/smbpasswd.c3
-rw-r--r--source3/utils/status.c3
-rw-r--r--source3/utils/testparm.c3
8 files changed, 28 insertions, 0 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index bf0e0f6b04c..33ce7e30f74 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -32,6 +32,7 @@ const char prog_name[] = "smbclient";
struct cli_state *cli;
extern BOOL in_client;
+extern BOOL AllowDebugChange;
static int port = 0;
pstring cur_dir = "\\";
pstring cd_path = "";
@@ -2411,6 +2412,7 @@ static int do_message_op(void)
*new_name_resolve_order = 0;
DEBUGLEVEL = 2;
+ AllowDebugChange = False;
setup_logging(pname,True);
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index a77328e3432..f3b0f2be124 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -86,6 +86,7 @@ BOOL append_log = False;
int DEBUGLEVEL_CLASS[DBGC_LAST];
BOOL DEBUGLEVEL_CLASS_ISSET[DBGC_LAST];
int DEBUGLEVEL = DEBUGLEVEL_CLASS;
+BOOL AllowDebugChange = True;
/* -------------------------------------------------------------------------- **
@@ -222,6 +223,8 @@ BOOL debug_parse_levels(char *params_str)
int debuglevel_class[DBGC_LAST];
BOOL debuglevel_class_isset[DBGC_LAST];
+ if (AllowDebugChange == False)
+ return True;
ZERO_ARRAY(params);
ZERO_ARRAY(debuglevel_class);
ZERO_ARRAY(debuglevel_class_isset);
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index 5b22872cb37..db70cb302a5 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/utils/nmblookup.c
@@ -24,6 +24,8 @@
#include "includes.h"
+extern BOOL AllowDebugChange;
+
static BOOL use_bcast = True;
static BOOL got_bcast = False;
static struct in_addr bcast_addr;
@@ -195,6 +197,9 @@ int main(int argc,char *argv[])
int commandline_debuglevel = -2;
DEBUGLEVEL = 1;
+ /* Prevent smb.conf setting from overridding */
+ AllowDebugChange = False;
+
*lookup = 0;
setup_logging(argv[0],True);
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index ab7c9d6f7c1..046d4a4ad80 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -32,6 +32,7 @@
#include "includes.h"
extern pstring global_myname;
+extern BOOL AllowDebugChange;
/*
* Next two lines needed for SunOS and don't
@@ -568,6 +569,9 @@ int main (int argc, char **argv)
exit(1);
}
+ DEBUGLEVEL = 1;
+ AllowDebugChange = False;
+
if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n",
dyn_CONFIGFILE);
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 3562caf5321..f03387c6e0d 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -22,6 +22,8 @@
#include "includes.h"
+extern BOOL AllowDebugChange;
+
static struct {
char *name;
int value;
@@ -423,6 +425,9 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params)
extern int optind;
BOOL interactive = False;
+ AllowDebugChange = False;
+ DEBUGLEVEL = 0;
+
setup_logging(argv[0],True);
if (argc < 2) usage(True);
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index ca1fe377d0d..6a20e71d966 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -20,6 +20,7 @@
#include "includes.h"
extern pstring global_myname;
+extern BOOL AllowDebugChange;
/*
* Next two lines needed for SunOS and don't
@@ -566,6 +567,8 @@ static int process_nonroot(int argc, char *argv[])
**********************************************************/
int main(int argc, char **argv)
{
+ AllowDebugChange = False;
+
#if defined(HAVE_SET_AUTH_PARAMETERS)
set_auth_parameters(argc, argv);
#endif /* HAVE_SET_AUTH_PARAMETERS */
diff --git a/source3/utils/status.c b/source3/utils/status.c
index e17a6589efe..98e601382b3 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -36,6 +36,8 @@
#include "includes.h"
+extern BOOL AllowDebugChange;
+
struct session_record{
pid_t pid;
uid_t uid;
@@ -550,6 +552,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
setup_logging(argv[0],True);
+ AllowDebugChange = False;
DEBUGLEVEL = 0;
dbf = x_stderr;
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 97dc0c014a2..164eb1b29b0 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -35,6 +35,8 @@
#include "includes.h"
#include "smb.h"
+extern BOOL AllowDebugChange;
+
/***********************************************
Here we do a set of 'hard coded' checks for bad
configuration settings.
@@ -216,6 +218,7 @@ int main(int argc, char *argv[])
dbf = x_stdout;
DEBUGLEVEL = 2;
+ AllowDebugChange = False;
printf("Load smb config files from %s\n",configfile);