s4-param Set szConfigFile even for s3 loadparm contexts
[amitay/samba.git] / source4 / param / loadparm.c
index c1fd5f22a249eb213d1c251b0390ce44355bd29e..ba9668a1c645488e83add8c19fc668c8e4ba237b 100644 (file)
@@ -3514,14 +3514,14 @@ bool lpcfg_load(struct loadparm_context *lp_ctx, const char *filename)
        char *n2;
        bool bRetval;
 
-       if (lp_ctx->s3_fns) {
-               return lp_ctx->s3_fns->load(filename);
-       }
-
        filename = talloc_strdup(lp_ctx, filename);
 
        lp_ctx->szConfigFile = filename;
 
+       if (lp_ctx->s3_fns) {
+               return lp_ctx->s3_fns->load(filename);
+       }
+
        lp_ctx->bInGlobalSection = true;
        n2 = standard_sub_basic(lp_ctx, lp_ctx->szConfigFile);
        DEBUG(2, ("lpcfg_load: refreshing parameters from %s\n", n2));