param: attempt to start factoring out the bInGlobalSection parameter
authorGarming Sam <garming@catalyst.net.nz>
Thu, 27 Feb 2014 22:09:24 +0000 (11:09 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 7 Jul 2014 21:32:36 +0000 (23:32 +0200)
Eventually this parameter should be solely on the loadparm context. It
should really only have meaning during the globals init.

Change-Id: If0fd2037ce4e8399fbf00f63bc138d9c146d7570
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
source3/param/loadparm.c

index a0afa5d49a9e8e1a9a482a9fdabc194184768f96..40852968b90c71d13d117fbbcc6f89d09288dd27 100644 (file)
@@ -2361,7 +2361,7 @@ static void init_iconv(void)
 ***************************************************************************/
 static bool bAllowIncludeRegistry = true;
 
-bool lp_include(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
+bool lp_include(struct loadparm_context *lp_ctx, int snum, const char *pszParmValue, char **ptr)
 {
        char *fname;
 
@@ -2375,7 +2375,7 @@ bool lp_include(struct loadparm_context *unused, int snum, const char *pszParmVa
                if (!bAllowIncludeRegistry) {
                        return true;
                }
-               if (bInGlobalSection) {
+               if (lp_ctx->bInGlobalSection) {
                        bool ret;
                        include_depth++;
                        ret = process_registry_globals();
@@ -2646,6 +2646,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue
                                                                   loadparm_s3_helpers());
                lp_ctx->sDefault = &sDefault;
                lp_ctx->services = ServicePtrs;
+               lp_ctx->bInGlobalSection = bInGlobalSection;
                ok = parm_table[parmnum].special(lp_ctx, snum, pszParmValue,
                                                  (char **)parm_ptr);
                TALLOC_FREE(frame);