summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-28 01:17:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:25 -0500
commit37d53832a4623653f706e77985a79d84bd7c6694 (patch)
tree265e308027d6641bbdb29a4feddbe86ef8b25fd1 /source4/scripting/ejs
parente09226cb35d627affddc08c4a88527184b8ffcf9 (diff)
downloadsamba-37d53832a4623653f706e77985a79d84bd7c6694.tar.gz
samba-37d53832a4623653f706e77985a79d84bd7c6694.tar.bz2
samba-37d53832a4623653f706e77985a79d84bd7c6694.zip
r25398: Parse loadparm context to all lp_*() functions.
(This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238)
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r--source4/scripting/ejs/ejsnet/net_ctx.c2
-rw-r--r--source4/scripting/ejs/smbcalls.c2
-rw-r--r--source4/scripting/ejs/smbcalls_cli.c4
-rw-r--r--source4/scripting/ejs/smbcalls_config.c2
-rw-r--r--source4/scripting/ejs/smbcalls_creds.c2
-rw-r--r--source4/scripting/ejs/smbscript.c6
6 files changed, 10 insertions, 8 deletions
diff --git a/source4/scripting/ejs/ejsnet/net_ctx.c b/source4/scripting/ejs/ejsnet/net_ctx.c
index a2a3821082..5fdfe51887 100644
--- a/source4/scripting/ejs/ejsnet/net_ctx.c
+++ b/source4/scripting/ejs/ejsnet/net_ctx.c
@@ -68,7 +68,7 @@ static int ejs_net_context(MprVarHandle eid, int argc, struct MprVar **argv)
talloc_free(ctx);
return -1;
}
- cli_credentials_set_conf(creds);
+ cli_credentials_set_conf(creds, global_loadparm);
cli_credentials_set_anonymous(creds);
mprCreds = mprCredentials(creds);
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c
index 3cb860b9e3..91e58873df 100644
--- a/source4/scripting/ejs/smbcalls.c
+++ b/source4/scripting/ejs/smbcalls.c
@@ -111,7 +111,7 @@ static int ejs_typeof_native(MprVarHandle eid, int argc, struct MprVar **argv)
static int ejs_libinclude(int eid, int argc, char **argv)
{
int i, j;
- const char **js_include = lp_js_include();
+ const char **js_include = lp_js_include(global_loadparm);
if (js_include == NULL || js_include[0] == NULL) {
ejsSetErrorMsg(eid, "js include path not set");
diff --git a/source4/scripting/ejs/smbcalls_cli.c b/source4/scripting/ejs/smbcalls_cli.c
index 02b948182a..af86be9432 100644
--- a/source4/scripting/ejs/smbcalls_cli.c
+++ b/source4/scripting/ejs/smbcalls_cli.c
@@ -431,7 +431,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
/* Set up credentials */
creds = cli_credentials_init(NULL);
- cli_credentials_set_conf(creds);
+ cli_credentials_set_conf(creds, global_loadparm);
cli_credentials_parse_string(creds, argv[1], CRED_SPECIFIED);
/* Do connect */
@@ -443,7 +443,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
io.in.service_type = "?????";
io.in.credentials = creds;
io.in.fallback_to_anonymous = False;
- io.in.workgroup = lp_workgroup();
+ io.in.workgroup = lp_workgroup(global_loadparm);
result = smb_composite_connect(&io, mem_ctx, NULL);
tree = io.out.tree;
diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c
index f488b0745f..45c197834a 100644
--- a/source4/scripting/ejs/smbcalls_config.c
+++ b/source4/scripting/ejs/smbcalls_config.c
@@ -211,7 +211,7 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv)
*/
static int ejs_lpReload(MprVarHandle eid, int argc, char **argv)
{
- BOOL ret = lp_load();
+ BOOL ret = lp_load(lp_configfile(global_loadparm));
if (ret) {
unload_interfaces();
}
diff --git a/source4/scripting/ejs/smbcalls_creds.c b/source4/scripting/ejs/smbcalls_creds.c
index b469f2c9fe..730753d158 100644
--- a/source4/scripting/ejs/smbcalls_creds.c
+++ b/source4/scripting/ejs/smbcalls_creds.c
@@ -248,7 +248,7 @@ static int ejs_credentials_init(MprVarHandle eid, int argc, struct MprVar **argv
return -1;
}
- cli_credentials_set_conf(creds);
+ cli_credentials_set_conf(creds, global_loadparm);
return ejs_credentials_obj(obj, creds);
}
diff --git a/source4/scripting/ejs/smbscript.c b/source4/scripting/ejs/smbscript.c
index 9f7e048fc0..29ce763f96 100644
--- a/source4/scripting/ejs/smbscript.c
+++ b/source4/scripting/ejs/smbscript.c
@@ -26,6 +26,7 @@
#include "scripting/ejs/smbcalls.h"
#include "auth/gensec/gensec.h"
#include "ldb/include/ldb.h"
+#include "dynconfig.h"
static EjsId eid;
@@ -52,7 +53,9 @@ int main(int argc, const char **argv)
fault_setup(argv[0]);
if (getenv("SMB_CONF_PATH")) {
- lp_set_cmdline(global_loadparm, "config file", getenv("SMB_CONF_PATH"));
+ lp_load(getenv("SMB_CONF_PATH"));
+ } else {
+ lp_load(dyn_CONFIGFILE);
}
ldb_global_init();
@@ -60,7 +63,6 @@ int main(int argc, const char **argv)
gensec_init();
mprSetCtx(mem_ctx);
- lp_load();
if (argc < 2) {
fprintf(stderr, "You must supply a script name\n");