[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3232-g5a0883a

Michael Adam obnox at samba.org
Tue Jul 15 11:10:38 GMT 2008


The branch, v3-3-test has been updated
       via  5a0883a7f28538fad542293e1d9361e8c4bed1fd (commit)
       via  e7d08b673066a63aaa7ab54ac59566ae8a975672 (commit)
      from  cd5d13dec0153c64d541e85bd13138b738cf50af (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 5a0883a7f28538fad542293e1d9361e8c4bed1fd
Author: Michael Adam <obnox at samba.org>
Date:   Tue Jul 15 11:26:43 2008 +0200

    testparm: allow the default debug level of 2 to be changed from the command line.
    
    Michael

commit e7d08b673066a63aaa7ab54ac59566ae8a975672
Author: Michael Adam <obnox at samba.org>
Date:   Tue Jul 15 11:26:11 2008 +0200

    popt: add a popt_common_debuglevel set of options providing -d|--debuglevel
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source/include/popt_common.h |    2 ++
 source/lib/popt_common.c     |    6 ++++++
 source/utils/testparm.c      |    9 ++++++++-
 3 files changed, 16 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/popt_common.h b/source/include/popt_common.h
index c889d2e..bbd013a 100644
--- a/source/include/popt_common.h
+++ b/source/include/popt_common.h
@@ -28,6 +28,7 @@ extern struct poptOption popt_common_connection[];
 extern struct poptOption popt_common_configfile[];
 extern struct poptOption popt_common_version[];
 extern struct poptOption popt_common_credentials[];
+extern struct poptOption popt_common_debuglevel[];
 extern const struct poptOption popt_common_dynconfig[];
 
 #ifndef POPT_TABLEEND
@@ -42,6 +43,7 @@ extern const struct poptOption popt_common_dynconfig[];
 #define POPT_COMMON_DYNCONFIG { NULL, 0, POPT_ARG_INCLUDE_TABLE, \
     CONST_DISCARD(poptOption *, popt_common_dynconfig), 0, \
     "Build-time configuration overrides:", NULL },
+#define POPT_COMMON_DEBUGLEVEL { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debuglevel, 0, "Common samba debugging:", NULL },
 
 struct user_auth_info {
 	char *username;
diff --git a/source/lib/popt_common.c b/source/lib/popt_common.c
index 25e41ab..b151f22 100644
--- a/source/lib/popt_common.c
+++ b/source/lib/popt_common.c
@@ -171,6 +171,12 @@ struct poptOption popt_common_version[] = {
 	POPT_TABLEEND
 };
 
+struct poptOption popt_common_debuglevel[] = {
+	{ NULL, 0, POPT_ARG_CALLBACK, (void *)popt_common_callback },
+	{ "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
+	POPT_TABLEEND
+};
+
 
 /* Handle command line options:
  *		--sbindir
diff --git a/source/utils/testparm.c b/source/utils/testparm.c
index 212dcf0..527db2d 100644
--- a/source/utils/testparm.c
+++ b/source/utils/testparm.c
@@ -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);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list