summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/ejs/ejsrpc.c2
-rw-r--r--source4/scripting/ejs/smbcalls_config.c15
2 files changed, 9 insertions, 8 deletions
diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c
index 966c803a30..53660d433f 100644
--- a/source4/scripting/ejs/ejsrpc.c
+++ b/source4/scripting/ejs/ejsrpc.c
@@ -417,7 +417,7 @@ NTSTATUS ejs_push_array_uint8(struct ejs_rpc *ejs,
const uint8_t *r, uint32_t length)
{
DATA_BLOB blob;
- blob.data = discard_const(r);
+ blob.data = (uint8_t *)discard_const(r);
blob.length = length;
mprSetVar(v, name, mprDataBlob(blob));
return NT_STATUS_OK;
diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c
index b31b70bda8..6da978663a 100644
--- a/source4/scripting/ejs/smbcalls_config.c
+++ b/source4/scripting/ejs/smbcalls_config.c
@@ -37,7 +37,7 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv)
if (argc != 0) return -1;
for (i=0;i<lp_numservices();i++) {
- list = str_list_add(list, lp_servicename(i));
+ list = str_list_add(list, lp_servicename(lp_servicebynum(i)));
}
talloc_steal(mprMemCtx(), list);
mpr_Return(eid, mprList("services", list));
@@ -87,9 +87,10 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv)
if (argc < 1) return -1;
if (argc == 2) {
+ struct service *service;
/* its a share parameter */
- int snum = lp_servicenumber(argv[0]);
- if (snum == -1) {
+ service = lp_service(argv[0]);
+ if (service == NULL) {
mpr_Return(eid, mprCreateUndefinedVar());
return 0;
}
@@ -104,7 +105,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv)
mpr_Return(eid, mprCreateUndefinedVar());
return 0;
}
- value = lp_get_parametric(snum, type, option);
+ value = lp_get_parametric(service, type, option);
if (value == NULL) {
mpr_Return(eid, mprCreateUndefinedVar());
return 0;
@@ -118,7 +119,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv)
mpr_Return(eid, mprCreateUndefinedVar());
return 0;
}
- parm_ptr = lp_parm_ptr(snum, parm);
+ parm_ptr = lp_parm_ptr(service, parm);
} else if (strchr(argv[0], ':')) {
/* its a global parametric option */
const char *type = talloc_strndup(mprMemCtx(),
@@ -129,7 +130,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv)
mpr_Return(eid, mprCreateUndefinedVar());
return 0;
}
- value = lp_get_parametric(-1, type, option);
+ value = lp_get_parametric(NULL, type, option);
if (value == NULL) {
mpr_Return(eid, mprCreateUndefinedVar());
return 0;
@@ -143,7 +144,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv)
mpr_Return(eid, mprCreateUndefinedVar());
return 0;
}
- parm_ptr = lp_parm_ptr(-1, parm);
+ parm_ptr = lp_parm_ptr(NULL, parm);
}
if (parm == NULL || parm_ptr == NULL) {