From 2c0322218151a183d57e12e26750e3d69e4b172f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 15 May 2009 01:46:09 +0200 Subject: [PATCH] s3:param: prevent includes from being dumped in dump_*() functions. This fixes bug #4271: testparm should not print includes. Michael --- source/include/smb.h | 1 + source/param/loadparm.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/include/smb.h b/source/include/smb.h index 56d9461..c8ec4c4 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -917,6 +917,7 @@ struct parm_struct { #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */ #define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */ #define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */ +#define FLAG_META 0x8000 /* A meta directive - not a real parameter */ struct bitmap { uint32 *b; diff --git a/source/param/loadparm.c b/source/param/loadparm.c index 3908aef..891d640 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -1016,7 +1016,7 @@ static struct parm_struct parm_table[] = { .ptr = &Globals.ConfigBackend, .special = NULL, .enum_list = enum_config_backend, - .flags = FLAG_ADVANCED, + .flags = FLAG_ADVANCED|FLAG_META, }, {N_("Security Options"), P_SEP, P_SEPARATOR}, @@ -3690,7 +3690,7 @@ static struct parm_struct parm_table[] = { .ptr = &Globals.szConfigFile, .special = NULL, .enum_list = NULL, - .flags = FLAG_HIDE, + .flags = FLAG_HIDE|FLAG_META, }, { .label = "preload", @@ -3935,7 +3935,7 @@ static struct parm_struct parm_table[] = { .ptr = &sDefault.szInclude, .special = handle_include, .enum_list = NULL, - .flags = FLAG_HIDE, + .flags = FLAG_HIDE|FLAG_META, }, { .label = "preexec", @@ -7561,6 +7561,7 @@ static void dump_globals(FILE *f) for (i = 0; parm_table[i].label; i++) if (parm_table[i].p_class == P_GLOBAL && + !(parm_table[i].flags & FLAG_META) && parm_table[i].ptr && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) { if (defaults_saved && is_default(i)) @@ -7607,6 +7608,7 @@ static void dump_a_service(struct service *pService, FILE * f) for (i = 0; parm_table[i].label; i++) { if (parm_table[i].p_class == P_LOCAL && + !(parm_table[i].flags & FLAG_META) && parm_table[i].ptr && (*parm_table[i].label != '-') && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) @@ -7683,6 +7685,7 @@ bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal) for (i = 0; parm_table[i].label; i++) { if (strwicmp(parm_table[i].label, parm_name) == 0 && + !(parm_table[i].flags & FLAG_META) && (parm_table[i].p_class == p_class || parm_table[i].flags & flag) && parm_table[i].ptr && (*parm_table[i].label != '-') && -- 1.6.0.2