diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-08 23:32:37 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:48:56 +0100 |
commit | dd7e5ed88c48f4ee39e53be07c8839791e914e45 (patch) | |
tree | fca88a741257b2f5165f3762de6c44053888fc3e /source4/scripting/ejs/smbcalls_config.c | |
parent | 75ac6cd318ae58aacc77785ba93af50bfe354b63 (diff) | |
download | samba-dd7e5ed88c48f4ee39e53be07c8839791e914e45.tar.gz samba-dd7e5ed88c48f4ee39e53be07c8839791e914e45.tar.bz2 samba-dd7e5ed88c48f4ee39e53be07c8839791e914e45.zip |
r26352: Don't make lp_load create a new context.
(This used to be commit d0d5c1a823a6601292c061dba2b6f4bde2b9e3dd)
Diffstat (limited to 'source4/scripting/ejs/smbcalls_config.c')
-rw-r--r-- | source4/scripting/ejs/smbcalls_config.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 157587186c..88c153ead3 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -161,6 +161,14 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) return 0; } +/* + v = lp.filename(); obtain filename +*/ +static int ejs_lpFilename(MprVarHandle eid, int argc, char **argv) +{ + mpr_ReturnString(eid, lp_configfile(global_loadparm)); + return 0; +} /* set a smb.conf parameter. Only sets in memory, not permanent @@ -188,8 +196,9 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv) static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) { bool ret; - - ret = lp_load(talloc_autofree_context(), lp_configfile(global_loadparm), NULL); + const char *filename = lp_configfile(global_loadparm); + + ret = lp_load(global_loadparm, filename); if (ret) { unload_interfaces(); } @@ -208,6 +217,7 @@ static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv) mprSetStringCFunction(obj, "set", ejs_lpSet); mprSetStringCFunction(obj, "reload", ejs_lpReload); mprSetStringCFunction(obj, "services", ejs_lpServices); + mprSetStringCFunction(obj, "filename", ejs_lpFilename); return 0; } |