From 3154381e44923f0b7bb1f996aa24d70118d39eed Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 10 Sep 2020 10:42:30 +0200 Subject: [PATCH] param: do not skip non-global includes Configuration content in include files can define global attributes even if not included from a place that it itself in global context. This makes smb.conf behave unexpectedly as it isn't handled as documented: "... is included literally, as though typed in place". Do not skip param processing for "include" params even if global_only is set. Bug: https://bugzilla.samba.org/show_bug.cgi?id=14481 Signed-off-by: Christian Ehrhardt --- source3/param/loadparm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c218e2fc372..1e33c05e491 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2738,8 +2738,13 @@ bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue) static bool do_parameter(const char *pszParmName, const char *pszParmValue, void *userdata) { - if (!bInGlobalSection && bGlobalOnly) - return true; + if (!bInGlobalSection && bGlobalOnly) { + if (strcmp(pszParmName,"include") == 0) { + DEBUGADD(4, ("not skipping non-global include\n")); + } else { + return true; + } + } DEBUGADD(4, ("doing parameter %s = %s\n", pszParmName, pszParmValue)); -- 2.28.0