summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs/smbcalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/ejs/smbcalls.c')
-rw-r--r--source4/scripting/ejs/smbcalls.c51
1 files changed, 3 insertions, 48 deletions
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c
index bc7994a007..8a3ce245d2 100644
--- a/source4/scripting/ejs/smbcalls.c
+++ b/source4/scripting/ejs/smbcalls.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "param/param.h"
#include "scripting/ejs/smbcalls.h"
#include "build.h"
#include "version.h"
@@ -110,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");
@@ -160,51 +161,6 @@ static int ejs_version(MprVarHandle eid, int argc, struct MprVar **argv)
}
-/*
- * jsonrpc_include() allows you to include jsonrpc files from a path based at
- * "jsonrpc services directory =" in smb.conf.
- */
-static int jsonrpc_include(int eid, int argc, char **argv)
-{
- int ret = -1;
- char *path;
- char *emsg;
- const char *jsonrpc_services_dir = lp_jsonrpc_services_dir();
- struct MprVar result;
-
-
- if (jsonrpc_services_dir == NULL || jsonrpc_services_dir == NULL) {
- ejsSetErrorMsg(eid, "'jsonrpc services directory' not set");
- return -1;
- }
-
- if (argc != 1) {
- mpr_Return(eid, mprCreateIntegerVar(-1));
- return 0;
- }
-
- path = talloc_asprintf(mprMemCtx(), "%s/%s",
- jsonrpc_services_dir,
- argv[0]);
- if (path == NULL) {
- mpr_Return(eid, mprCreateIntegerVar(-1));
- return 0;
- }
-
- if (file_exist(path)) {
- ret = ejsEvalFile(eid, path, &result, &emsg);
- if (ret < 0) {
- ejsSetErrorMsg(eid, "Could not eval file");
- printf("file found; ret=%d (%s)\n", ret, emsg);
- }
- }
-
- mpr_Return(eid, mprCreateIntegerVar(ret));
- talloc_free(path);
- return 0;
-}
-
-
static void (*ejs_exception_handler) (const char *) = NULL;
_PUBLIC_ void ejs_exception(const char *reason)
@@ -228,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, "smbcalls");
+ shared_init = load_samba_modules(NULL, global_loadparm, "smbcalls");
run_init_functions(static_init);
run_init_functions(shared_init);
@@ -239,6 +195,5 @@ void smb_setup_ejs_functions(void (*exception_handler)(const char *))
ejsDefineCFunction(-1, "nativeTypeOf", ejs_typeof_native, NULL, MPR_VAR_SCRIPT_HANDLE);
ejsDefineStringCFunction(-1, "libinclude", ejs_libinclude, NULL, MPR_VAR_SCRIPT_HANDLE);
ejsDefineCFunction(-1, "version", ejs_version, NULL, MPR_VAR_SCRIPT_HANDLE);
- ejsDefineStringCFunction(-1, "jsonrpc_include", jsonrpc_include, NULL, MPR_VAR_SCRIPT_HANDLE);
}