summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index be5464c8e6..9065a48113 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -2407,7 +2407,7 @@ bool loadparm_init(struct loadparm_context *lp_ctx)
_PUBLIC_ _DEPRECATED_ bool lp_load_default(void)
{
- return lp_load(dyn_CONFIGFILE);
+ return lp_load(dyn_CONFIGFILE, NULL);
}
/***************************************************************************
@@ -2415,13 +2415,16 @@ _PUBLIC_ _DEPRECATED_ bool lp_load_default(void)
False on failure.
***************************************************************************/
-bool lp_load(const char *filename)
+bool lp_load(const char *filename, struct loadparm_context **ret_lp)
{
char *n2;
bool bRetval;
struct param_opt *data;
struct loadparm_context *lp_ctx = &loadparm;
+ if (ret_lp != NULL)
+ *ret_lp = NULL;
+
filename = talloc_strdup(talloc_autofree_context(), filename);
global_loadparm = lp_ctx;
@@ -2470,6 +2473,9 @@ bool lp_load(const char *filename)
close_iconv();
+ if (ret_lp != NULL)
+ *ret_lp = lp_ctx;
+
return bRetval;
}