testparm: allow the default debug level of 2 to be changed from the command line.
authorMichael Adam <obnox@samba.org>
Tue, 15 Jul 2008 09:26:43 +0000 (11:26 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 15 Jul 2008 11:03:24 +0000 (13:03 +0200)
Michael

source/utils/testparm.c

index 212dcf0676b7fe097e6bf7517b116a4b5f7325ed..527db2d805330597ad2e4ca27fedccf820a53a86 100644 (file)
@@ -296,12 +296,19 @@ rameter is ignored when using CUPS libraries.\n",
                {"parameter-name", '\0', POPT_ARG_STRING, &parameter_name, 0, "Limit testparm to a named parameter" },
                {"section-name", '\0', POPT_ARG_STRING, &section_name, 0, "Limit testparm to a named section" },
                POPT_COMMON_VERSION
+               POPT_COMMON_DEBUGLEVEL
                POPT_TABLEEND
        };
 
        TALLOC_CTX *frame = talloc_stackframe();
 
        load_case_tables();
+       /*
+        * Set the default debug level to 2.
+        * Allow it to be overridden by the command line,
+        * not by smb.conf.
+        */
+       DEBUGLEVEL_CLASS[DBGC_ALL] = 2;
 
        pc = poptGetContext(NULL, argc, argv, long_options, 
                            POPT_CONTEXT_KEEP_FIRST);
@@ -332,7 +339,7 @@ rameter is ignored when using CUPS libraries.\n",
        }
 
        dbf = x_stderr;
-       DEBUGLEVEL = 2;
+       /* Don't let the debuglevel be changed by smb.conf. */
        AllowDebugChange = False;
 
        fprintf(stderr,"Load smb config files from %s\n",config_file);