merge changes from 2.2 branch to prevent smb.conf from changing debug level
authorHerb Lewis <herb@samba.org>
Mon, 7 Jan 2002 21:32:22 +0000 (21:32 +0000)
committerHerb Lewis <herb@samba.org>
Mon, 7 Jan 2002 21:32:22 +0000 (21:32 +0000)
of commands when specified on command line.
(This used to be commit 39d6b31e14144a3ff4b992d4286b706147e58566)

source3/client/client.c
source3/lib/debug.c
source3/utils/nmblookup.c
source3/utils/pdbedit.c
source3/utils/smbcontrol.c
source3/utils/smbpasswd.c
source3/utils/status.c
source3/utils/testparm.c

index bf0e0f6b04c037cff91b95f81b55e08f5017b0f1..33ce7e30f74ed75acca7a0e4ef03e1262688827c 100644 (file)
@@ -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);
 
index a77328e34321d10a5b1ac3de238c677891a24957..f3b0f2be124cec70dd349492c3c680d3683485f2 100644 (file)
@@ -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);
index 5b22872cb37f80e5d3408b0c571eca136578495e..db70cb302a54b442389e77f385d4e5520f7dea03 100644 (file)
@@ -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);
index ab7c9d6f7c1b8a9666ea25129e18b8673bde251f..046d4a4ad80d4ee7c33d8a0820cd157376553be2 100644 (file)
@@ -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);
index 3562caf532173179407f7f5452a024a70077c5bb..f03387c6e0dd02df746cece5618b263b16cd9b7f 100644 (file)
@@ -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);
index ca1fe377d0d5427f02aceb3305842aa7868389dd..6a20e71d966a8992acccf3a715b162f3a248ff41 100644 (file)
@@ -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 */
index e17a6589efe3378b2fb76d72cb96c8886bbb2bad..98e601382b33d6f5f4cedd713fda33a34f09614c 100644 (file)
@@ -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;
        
index 97dc0c014a2f549621fc353544369040435be08f..164eb1b29b0eb8e4cf5470144da1d394d1a13bc4 100644 (file)
@@ -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);