diff options
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r-- | source4/scripting/ejs/config.mk | 65 | ||||
-rw-r--r-- | source4/scripting/ejs/ejsnet/config.mk | 14 | ||||
-rw-r--r-- | source4/scripting/ejs/ejsnet/net_ctx.c | 2 | ||||
-rw-r--r-- | source4/scripting/ejs/ejsnet/net_user.c | 5 | ||||
-rw-r--r-- | source4/scripting/ejs/smbcalls.c | 27 | ||||
-rw-r--r-- | source4/scripting/ejs/smbcalls_auth.c | 4 | ||||
-rw-r--r-- | source4/scripting/ejs/smbcalls_ldb.c | 2 | ||||
-rw-r--r-- | source4/scripting/ejs/smbcalls_nbt.c | 2 | ||||
-rw-r--r-- | source4/scripting/ejs/smbcalls_reg.c | 2 | ||||
-rw-r--r-- | source4/scripting/ejs/smbcalls_rpc.c | 4 |
10 files changed, 84 insertions, 43 deletions
diff --git a/source4/scripting/ejs/config.mk b/source4/scripting/ejs/config.mk index 33a4ac915f..c1a1ca1f0f 100644 --- a/source4/scripting/ejs/config.mk +++ b/source4/scripting/ejs/config.mk @@ -1,84 +1,86 @@ [SUBSYSTEM::EJSRPC] -OBJ_FILES = \ - ejsrpc.o + +EJSRPC_OBJ_FILES = $(ejsscriptsrcdir)/ejsrpc.o [MODULE::smbcalls_config] -OBJ_FILES = smbcalls_config.o OUTPUT_TYPE = MERGED_OBJ SUBSYSTEM = smbcalls INIT_FUNCTION = smb_setup_ejs_config +smbcalls_config_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_config.o + [MODULE::smbcalls_ldb] -OBJ_FILES = smbcalls_ldb.o OUTPUT_TYPE = MERGED_OBJ SUBSYSTEM = smbcalls INIT_FUNCTION = smb_setup_ejs_ldb PRIVATE_DEPENDENCIES = LIBLDB SAMDB LIBNDR +smbcalls_ldb_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_ldb.o + [MODULE::smbcalls_reg] -OBJ_FILES = smbcalls_reg.o SUBSYSTEM = smbcalls OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = smb_setup_ejs_reg PRIVATE_DEPENDENCIES = registry SAMDB LIBNDR +smbcalls_reg_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_reg.o + [MODULE::smbcalls_nbt] -OBJ_FILES = smbcalls_nbt.o SUBSYSTEM = smbcalls OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = smb_setup_ejs_nbt +smbcalls_nbt_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_nbt.o + [MODULE::smbcalls_rand] -OBJ_FILES = smbcalls_rand.o SUBSYSTEM = smbcalls OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = smb_setup_ejs_random +smbcalls_rand_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_rand.o + [MODULE::smbcalls_nss] -OBJ_FILES = smbcalls_nss.o SUBSYSTEM = smbcalls OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = smb_setup_ejs_nss PRIVATE_DEPENDENCIES = NSS_WRAPPER +smbcalls_nss_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_nss.o + [MODULE::smbcalls_data] -OBJ_FILES = smbcalls_data.o SUBSYSTEM = smbcalls OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = smb_setup_ejs_datablob +smbcalls_data_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_data.o + [MODULE::smbcalls_auth] -OBJ_FILES = smbcalls_auth.o OUTPUT_TYPE = MERGED_OBJ SUBSYSTEM = smbcalls INIT_FUNCTION = smb_setup_ejs_auth -PRIVATE_DEPENDENCIES = auth +PRIVATE_DEPENDENCIES = service_auth + +smbcalls_auth_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_auth.o + +smbcalls_auth_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_auth.o [MODULE::smbcalls_string] -OBJ_FILES = smbcalls_string.o SUBSYSTEM = smbcalls OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = smb_setup_ejs_string +smbcalls_string_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_string.o + [MODULE::smbcalls_sys] -OBJ_FILES = smbcalls_sys.o SUBSYSTEM = smbcalls OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = smb_setup_ejs_system +smbcalls_sys_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_sys.o + mkinclude ejsnet/config.mk [SUBSYSTEM::smbcalls] -PRIVATE_PROTO_HEADER = proto.h -OBJ_FILES = \ - smbcalls.o \ - smbcalls_cli.o \ - smbcalls_rpc.o \ - smbcalls_options.o \ - smbcalls_creds.o \ - smbcalls_param.o \ - mprutil.o \ - literal.o PRIVATE_DEPENDENCIES = \ EJS LIBSAMBA-UTIL \ EJSRPC MESSAGING \ @@ -87,12 +89,23 @@ PRIVATE_DEPENDENCIES = \ dcerpc \ NDR_TABLE +smbcalls_OBJ_FILES = $(addprefix $(ejsscriptsrcdir)/, \ + smbcalls.o \ + smbcalls_cli.o \ + smbcalls_rpc.o \ + smbcalls_options.o \ + smbcalls_creds.o \ + smbcalls_param.o \ + mprutil.o \ + literal.o) + +$(eval $(call proto_header_template,$(ejsscriptsrcdir)/proto.h,$(smbcalls_OBJ_FILES:.o=.c))) + ####################### # Start BINARY SMBSCRIPT [BINARY::smbscript] -INSTALLDIR = BINDIR -OBJ_FILES = \ - smbscript.o PRIVATE_DEPENDENCIES = EJS LIBSAMBA-UTIL smbcalls LIBSAMBA-HOSTCONFIG # End BINARY SMBSCRIPT ####################### + +smbscript_OBJ_FILES = $(ejsscriptsrcdir)/smbscript.o diff --git a/source4/scripting/ejs/ejsnet/config.mk b/source4/scripting/ejs/ejsnet/config.mk index 249a33121d..710221e37d 100644 --- a/source4/scripting/ejs/ejsnet/config.mk +++ b/source4/scripting/ejs/ejsnet/config.mk @@ -1,11 +1,13 @@ [MODULE::smbcalls_net] -OBJ_FILES = \ +SUBSYSTEM = smbcalls +INIT_FUNCTION = smb_setup_ejs_net +PRIVATE_DEPENDENCIES = LIBSAMBA-NET LIBCLI_SMB CREDENTIALS + +smbcalls_net_OBJ_FILES = $(addprefix $(ejsscriptsrcdir)/ejsnet/, \ net_ctx.o \ net_user.o \ mpr_user.o \ net_host.o \ - mpr_host.o -SUBSYSTEM = smbcalls -INIT_FUNCTION = smb_setup_ejs_net -PRIVATE_PROTO_HEADER = proto.h -PRIVATE_DEPENDENCIES = LIBSAMBA-NET LIBCLI_SMB CREDENTIALS + mpr_host.o) + +$(eval $(call proto_header_template,$(ejsscriptsrcdir)/ejsnet/proto.h,$(smbcalls_net_OBJ_FILES:.o=.c))) diff --git a/source4/scripting/ejs/ejsnet/net_ctx.c b/source4/scripting/ejs/ejsnet/net_ctx.c index 99be1c4ef8..cbe163552e 100644 --- a/source4/scripting/ejs/ejsnet/net_ctx.c +++ b/source4/scripting/ejs/ejsnet/net_ctx.c @@ -50,7 +50,7 @@ static int ejs_net_context(MprVarHandle eid, int argc, struct MprVar **argv) ejsSetErrorMsg(eid, "talloc_new() failed"); return -1; } - ev = event_context_find(event_mem_ctx); + ev = mprEventCtx(); ctx = libnet_context_init(ev, mprLpCtx()); /* IF we generated a new event context, it will be under here, diff --git a/source4/scripting/ejs/ejsnet/net_user.c b/source4/scripting/ejs/ejsnet/net_user.c index 57e538d3b4..0c32035c6c 100644 --- a/source4/scripting/ejs/ejsnet/net_user.c +++ b/source4/scripting/ejs/ejsnet/net_user.c @@ -268,8 +268,9 @@ static int ejs_net_userinfo(MprVarHandle eid, int argc, char **argv) /* call the libnet function */ req.in.domain_name = userman_domain; - req.in.user_name = username; - + req.in.data.user_name = username; + req.in.level = USER_INFO_BY_NAME; + status = libnet_UserInfo(ctx, mem_ctx, &req); if (!NT_STATUS_IS_OK(status)) { ejsSetErrorMsg(eid, "%s", req.out.error_string); diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c index 63a80e17db..98d6be07bf 100644 --- a/source4/scripting/ejs/smbcalls.c +++ b/source4/scripting/ejs/smbcalls.c @@ -23,7 +23,6 @@ #include "includes.h" #include "param/param.h" #include "scripting/ejs/smbcalls.h" -#include "build.h" #include "version.h" /* @@ -173,6 +172,32 @@ _PUBLIC_ void ejs_exception(const char *reason) */ void smb_setup_ejs_functions(void (*exception_handler)(const char *)) { + extern NTSTATUS ejs_init_security(void); + extern NTSTATUS ejs_init_initshutdown(void); + extern NTSTATUS smb_setup_ejs_reg(void); + extern NTSTATUS smb_setup_ejs_string(void); + extern NTSTATUS ejs_init_lsarpc(void); + extern NTSTATUS ejs_init_rpcecho(void); + extern NTSTATUS ejs_init_winreg(void); + extern NTSTATUS smb_setup_ejs_random(void); + extern NTSTATUS smb_setup_ejs_config(void); + extern NTSTATUS ejs_init_misc(void); + extern NTSTATUS ejs_init_netdfs(void); + extern NTSTATUS smb_setup_ejs_datablob(void); + extern NTSTATUS smb_setup_ejs_auth(void); + extern NTSTATUS smb_setup_ejs_nss(void); + extern NTSTATUS ejs_init_samr(void); + extern NTSTATUS ejs_init_wkssvc(void); + extern NTSTATUS smb_setup_ejs_system(void); + extern NTSTATUS smb_setup_ejs_ldb(void); + extern NTSTATUS ejs_init_svcctl(void); + extern NTSTATUS smb_setup_ejs_nbt(void); + extern NTSTATUS smb_setup_ejs_net(void); + extern NTSTATUS ejs_init_srvsvc(void); + extern NTSTATUS ejs_init_netlogon(void); + extern NTSTATUS ejs_init_drsuapi(void); + extern NTSTATUS ejs_init_irpc(void); + extern NTSTATUS ejs_init_eventlog(void); init_module_fn static_init[] = { STATIC_smbcalls_MODULES }; init_module_fn *shared_init; diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c index 908a009159..b67bb7ed5b 100644 --- a/source4/scripting/ejs/smbcalls_auth.c +++ b/source4/scripting/ejs/smbcalls_auth.c @@ -55,7 +55,7 @@ static int ejs_doauth(MprVarHandle eid, msg = c->msg_ctx; } else { /* Hope we can find the event context somewhere up there... */ - ev = event_context_find(tmp_ctx); + ev = mprEventCtx(); msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, mprLpCtx()), lp_iconv_convenience(mprLpCtx()), ev); } @@ -109,7 +109,7 @@ static int ejs_doauth(MprVarHandle eid, goto done; } - nt_status = auth_generate_session_info(tmp_ctx, mprLpCtx(), server_info, &session_info); + nt_status = auth_generate_session_info(tmp_ctx, mprEventCtx(), 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)); diff --git a/source4/scripting/ejs/smbcalls_ldb.c b/source4/scripting/ejs/smbcalls_ldb.c index f47920b9bb..4a157945af 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(), mprLpCtx(), dbfile, + ldb = ldb_wrap_connect(mprMemCtx(), mprEventCtx(), 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 67a85414ca..8c555bf821 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(mprLpCtx()), &name, tmp_ctx, &reply_addr, event_context_find(tmp_ctx)); + nt_status = resolve_name(lp_resolve_context(mprLpCtx()), &name, tmp_ctx, &reply_addr, mprEventCtx()); 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 e20d91ad2e..ed8653d3a7 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, mprLpCtx(), NULL, NULL); + error = reg_open_samba(mprMemCtx(), &rctx, mprEventCtx(), 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 d1e49b4348..94774d708b 100644 --- a/source4/scripting/ejs/smbcalls_rpc.c +++ b/source4/scripting/ejs/smbcalls_rpc.c @@ -73,7 +73,7 @@ static int ejs_irpc_connect(MprVarHandle eid, int argc, char **argv) p->server_name = argv[0]; - ev = event_context_find(p); + ev = mprEventCtx(); /* create a messaging context, looping as we have no way to allocate temporary server ids automatically */ @@ -158,7 +158,7 @@ static int ejs_rpc_connect(MprVarHandle eid, int argc, char **argv) cli_credentials_set_anonymous(creds); } - ev = event_context_find(mprMemCtx()); + ev = mprEventCtx(); status = dcerpc_pipe_connect(this, &p, binding, iface, creds, ev, mprLpCtx()); |