[PATCH] testparm, give hint about 'log level'

Andreas Schneider asn at cryptomilk.org
Thu Aug 24 11:30:53 UTC 2017


Hey!

If you set 'log level = 10' in the smb.conf file and then run
'testparm -v', the log level will be displayed as '2'. The reason is
that testparm sets the default 'log level' to 2. So it will not print
what we have in the smb.conf file. We should tell this so users are
not confused.

The attached patch adds:

bin/testparm -s -v | grep 'log level'
  log level = 2 # (This is is not the value from smb.conf, but probably the
                   'default' of this command)

Review appreciated!


Thanks,


	Andreas



-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn at cryptomilk.org
-------------- next part --------------
>From d1a5ffda3057e2dcf536e6ccb70fecdd83ddf382 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 24 Aug 2017 13:21:02 +0200
Subject: [PATCH] param: Give a hint about 'log level' while dumping

If you set 'log level = 10' in the smb.conf file and then run
'testparm -v', the log level will be displayed as '2'. The reason is
that testparm sets the default 'log level' to 2. So it will not print
what we have in the smb.conf file. We should tell this so users are
not confused.

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 lib/param/loadparm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index a221e879d07..240e1d10c9f 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2244,6 +2244,11 @@ void lpcfg_dump_globals(struct loadparm_context *lp_ctx, FILE *f,
 
 		fprintf(f, "\t%s = ", parm_table[i].label);
 		lpcfg_print_parameter(&parm_table[i], lpcfg_parm_ptr(lp_ctx, NULL, &parm_table[i]), f);
+		if (strequal(parm_table[i].label, "log level")) {
+			fprintf(f, " # (This is is not the value from "
+				   "smb.conf, but probably the 'default' of "
+				   "this command)");
+		}
 		fprintf(f, "\n");
 	}
 	if (lp_ctx->globals->param_opt != NULL) {
-- 
2.14.1



More information about the samba-technical mailing list