From e11c61bc5cd487dce06fc38bb0ee8c4e24b04e8c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Feb 2008 18:21:44 +0100 Subject: Introduce mprLpCtx() similar to mprMemCtx() for loadparm_context used by all EJS code. (This used to be commit 184988866fe8e740f58e3683eefcaa70f8b51d11) --- source4/scripting/ejs/ejsnet/net_ctx.c | 4 ++-- source4/scripting/ejs/smbcalls.c | 4 ++-- source4/scripting/ejs/smbcalls_auth.c | 12 ++++++------ source4/scripting/ejs/smbcalls_cli.c | 8 ++++---- source4/scripting/ejs/smbcalls_config.c | 22 +++++++++++----------- source4/scripting/ejs/smbcalls_creds.c | 4 ++-- source4/scripting/ejs/smbcalls_data.c | 4 ++-- source4/scripting/ejs/smbcalls_ldb.c | 2 +- source4/scripting/ejs/smbcalls_nbt.c | 2 +- source4/scripting/ejs/smbcalls_reg.c | 2 +- source4/scripting/ejs/smbcalls_rpc.c | 6 +++--- source4/scripting/ejs/smbcalls_sys.c | 2 +- 12 files changed, 36 insertions(+), 36 deletions(-) (limited to 'source4/scripting/ejs') diff --git a/source4/scripting/ejs/ejsnet/net_ctx.c b/source4/scripting/ejs/ejsnet/net_ctx.c index 396718367a..99be1c4ef8 100644 --- a/source4/scripting/ejs/ejsnet/net_ctx.c +++ b/source4/scripting/ejs/ejsnet/net_ctx.c @@ -52,7 +52,7 @@ static int ejs_net_context(MprVarHandle eid, int argc, struct MprVar **argv) } ev = event_context_find(event_mem_ctx); - ctx = libnet_context_init(ev, global_loadparm); + ctx = libnet_context_init(ev, mprLpCtx()); /* IF we generated a new event context, it will be under here, * and we need it to last as long as the libnet context, so * make it a child */ @@ -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, global_loadparm); + cli_credentials_set_conf(creds, mprLpCtx()); cli_credentials_set_anonymous(creds); mprCreds = mprCredentials(creds); diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c index 1f29fce002..63a80e17db 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(global_loadparm); + const char **js_include = lp_js_include(mprLpCtx()); if (js_include == NULL || js_include[0] == NULL) { ejsSetErrorMsg(eid, "js include path not set"); @@ -184,7 +184,7 @@ void smb_setup_ejs_functions(void (*exception_handler)(const char *)) smb_setup_ejs_param(); smb_setup_ejs_literal(); - shared_init = load_samba_modules(NULL, global_loadparm, "smbcalls"); + shared_init = load_samba_modules(NULL, mprLpCtx(), "smbcalls"); run_init_functions(static_init); run_init_functions(shared_init); diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c index 89370890c8..908a009159 100644 --- a/source4/scripting/ejs/smbcalls_auth.c +++ b/source4/scripting/ejs/smbcalls_auth.c @@ -56,14 +56,14 @@ static int ejs_doauth(MprVarHandle eid, } else { /* Hope we can find the event context somewhere up there... */ ev = event_context_find(tmp_ctx); - msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, global_loadparm), - lp_iconv_convenience(global_loadparm), ev); + msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, mprLpCtx()), + lp_iconv_convenience(mprLpCtx()), ev); } if (auth_types) { - nt_status = auth_context_create_methods(tmp_ctx, auth_types, ev, msg, global_loadparm, &auth_context); + nt_status = auth_context_create_methods(tmp_ctx, auth_types, ev, msg, mprLpCtx(), &auth_context); } else { - nt_status = auth_context_create(tmp_ctx, ev, msg, global_loadparm, &auth_context); + nt_status = auth_context_create(tmp_ctx, ev, msg, mprLpCtx(), &auth_context); } if (!NT_STATUS_IS_OK(nt_status)) { mprSetPropertyValue(auth, "result", mprCreateBoolVar(false)); @@ -109,7 +109,7 @@ static int ejs_doauth(MprVarHandle eid, goto done; } - nt_status = auth_generate_session_info(tmp_ctx, global_loadparm, server_info, &session_info); + nt_status = auth_generate_session_info(tmp_ctx, mprLpCtx(), server_info, &session_info); if (!NT_STATUS_IS_OK(nt_status)) { mprSetPropertyValue(auth, "report", mprString("Session Info generation failed")); mprSetPropertyValue(auth, "result", mprCreateBoolVar(false)); @@ -222,7 +222,7 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv) static int ejs_system_session(MprVarHandle eid, int argc, struct MprVar **argv) { struct MprVar *obj = mprInitObject(eid, "session_info", argc, argv); - struct auth_session_info *session_info = system_session(mprMemCtx(), global_loadparm); + struct auth_session_info *session_info = system_session(mprMemCtx(), mprLpCtx()); if (session_info == NULL) { return -1; diff --git a/source4/scripting/ejs/smbcalls_cli.c b/source4/scripting/ejs/smbcalls_cli.c index 8295a0879f..4f2d52b25c 100644 --- a/source4/scripting/ejs/smbcalls_cli.c +++ b/source4/scripting/ejs/smbcalls_cli.c @@ -432,23 +432,23 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv) /* Set up credentials */ creds = cli_credentials_init(NULL); - cli_credentials_set_conf(creds, global_loadparm); + cli_credentials_set_conf(creds, mprLpCtx()); cli_credentials_parse_string(creds, argv[1], CRED_SPECIFIED); /* Do connect */ io.in.dest_host = hostname; - io.in.dest_ports = lp_smb_ports(global_loadparm); + io.in.dest_ports = lp_smb_ports(mprLpCtx()); io.in.called_name = strupper_talloc(mem_ctx, hostname); io.in.service = sharename; io.in.service_type = "?????"; io.in.credentials = creds; io.in.fallback_to_anonymous = false; - io.in.workgroup = lp_workgroup(global_loadparm); + io.in.workgroup = lp_workgroup(mprLpCtx()); lp_smbcli_options(global_loadparm, &io.in.options); result = smb_composite_connect(&io, mem_ctx, - lp_resolve_context(global_loadparm), + lp_resolve_context(mprLpCtx()), NULL); tree = io.out.tree; diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 07e0f479da..eb673b3a23 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -36,8 +36,8 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) const char **list = NULL; if (argc != 0) return -1; - for (i=0;idata, blob->length, (void **)&s); if (len == -1) { ejsSetErrorMsg(eid, "regToVar invalid REG_SZ string"); @@ -225,7 +225,7 @@ static int ejs_regToVar(MprVarHandle eid, int argc, struct MprVar **argv) if (slen == 2 && b.length == 2 && SVAL(b.data, 0) == 0) { break; } - len = convert_string_talloc(mprMemCtx(), lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, + len = convert_string_talloc(mprMemCtx(), lp_iconv_convenience(mprLpCtx()), CH_UTF16, CH_UNIX, b.data, slen, (void **)&s); if (len == -1) { ejsSetErrorMsg(eid, "regToVar invalid REG_MULTI_SZ string"); diff --git a/source4/scripting/ejs/smbcalls_ldb.c b/source4/scripting/ejs/smbcalls_ldb.c index 7599cbf443..f47920b9bb 100644 --- a/source4/scripting/ejs/smbcalls_ldb.c +++ b/source4/scripting/ejs/smbcalls_ldb.c @@ -453,7 +453,7 @@ static int ejs_ldbConnect(MprVarHandle eid, int argc, char **argv) dbfile = argv[0]; - ldb = ldb_wrap_connect(mprMemCtx(), global_loadparm, dbfile, + ldb = ldb_wrap_connect(mprMemCtx(), mprLpCtx(), dbfile, session_info, creds, 0, (const char **)(argv+1)); if (ldb == NULL) { diff --git a/source4/scripting/ejs/smbcalls_nbt.c b/source4/scripting/ejs/smbcalls_nbt.c index c3679b1ec7..67a85414ca 100644 --- a/source4/scripting/ejs/smbcalls_nbt.c +++ b/source4/scripting/ejs/smbcalls_nbt.c @@ -70,7 +70,7 @@ static int ejs_resolve_name(MprVarHandle eid, int argc, struct MprVar **argv) result = 0; - nt_status = resolve_name(lp_resolve_context(global_loadparm), &name, tmp_ctx, &reply_addr, event_context_find(tmp_ctx)); + nt_status = resolve_name(lp_resolve_context(mprLpCtx()), &name, tmp_ctx, &reply_addr, event_context_find(tmp_ctx)); if (NT_STATUS_IS_OK(nt_status)) { mprSetPropertyValue(argv[0], "value", mprString(reply_addr)); diff --git a/source4/scripting/ejs/smbcalls_reg.c b/source4/scripting/ejs/smbcalls_reg.c index 30e5357cfb..e20d91ad2e 100644 --- a/source4/scripting/ejs/smbcalls_reg.c +++ b/source4/scripting/ejs/smbcalls_reg.c @@ -70,7 +70,7 @@ static int ejs_reg_open(MprVarHandle eid, int argc, struct MprVar **argv) struct registry_context *rctx; WERROR error; - error = reg_open_samba(mprMemCtx(), &rctx, global_loadparm, NULL, NULL); + error = reg_open_samba(mprMemCtx(), &rctx, mprLpCtx(), NULL, NULL); SMB_ASSERT(W_ERROR_IS_OK(error)); mprSetPtrChild(reg, "registry", rctx); diff --git a/source4/scripting/ejs/smbcalls_rpc.c b/source4/scripting/ejs/smbcalls_rpc.c index 44cfa16d7e..d1e49b4348 100644 --- a/source4/scripting/ejs/smbcalls_rpc.c +++ b/source4/scripting/ejs/smbcalls_rpc.c @@ -79,9 +79,9 @@ static int ejs_irpc_connect(MprVarHandle eid, int argc, char **argv) allocate temporary server ids automatically */ for (i=0;i<10000;i++) { p->msg_ctx = messaging_init(p, - lp_messaging_path(p, global_loadparm), + lp_messaging_path(p, mprLpCtx()), cluster_id(EJS_ID_BASE, i), - lp_iconv_convenience(global_loadparm), + lp_iconv_convenience(mprLpCtx()), ev); if (p->msg_ctx) break; } @@ -161,7 +161,7 @@ static int ejs_rpc_connect(MprVarHandle eid, int argc, char **argv) ev = event_context_find(mprMemCtx()); status = dcerpc_pipe_connect(this, &p, binding, iface, creds, ev, - global_loadparm); + mprLpCtx()); if (!NT_STATUS_IS_OK(status)) goto done; /* callers don't allocate ref vars in the ejs interface */ diff --git a/source4/scripting/ejs/smbcalls_sys.c b/source4/scripting/ejs/smbcalls_sys.c index 72ddf90231..00599a55bc 100644 --- a/source4/scripting/ejs/smbcalls_sys.c +++ b/source4/scripting/ejs/smbcalls_sys.c @@ -36,7 +36,7 @@ static int ejs_sys_interfaces(MprVarHandle eid, int argc, struct MprVar **argv) struct MprVar ret = mprArray("interfaces"); struct interface *ifaces; - load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces); + load_interfaces(NULL, lp_interfaces(mprLpCtx()), &ifaces); count = iface_count(ifaces); for (i=0;i Date: Mon, 25 Feb 2008 12:51:55 +0100 Subject: Remove uses of global_loadparm. (This used to be commit a16c9a2129ce92e7e1a613b2badd168e42ead436) --- source4/scripting/ejs/smbcalls_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs') diff --git a/source4/scripting/ejs/smbcalls_cli.c b/source4/scripting/ejs/smbcalls_cli.c index 4f2d52b25c..dbb36312da 100644 --- a/source4/scripting/ejs/smbcalls_cli.c +++ b/source4/scripting/ejs/smbcalls_cli.c @@ -445,7 +445,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv) io.in.credentials = creds; io.in.fallback_to_anonymous = false; io.in.workgroup = lp_workgroup(mprLpCtx()); - lp_smbcli_options(global_loadparm, &io.in.options); + lp_smbcli_options(mprLpCtx(), &io.in.options); result = smb_composite_connect(&io, mem_ctx, lp_resolve_context(mprLpCtx()), -- cgit