summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-08 16:46:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:43 -0500
commit98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 (patch)
tree044b24a249cc2b63c2f69214d7e7da288c170c74 /source4/scripting/ejs
parentce0ff008b5c5af931526d14fa6232f8647e0880f (diff)
downloadsamba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.tar.gz
samba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.tar.bz2
samba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.zip
r25035: Fix some more warnings, use service pointer rather than service number in more places.
(This used to be commit df9cebcb97e20564359097148665bd519f31bc6f)
Diffstat (limited to 'source4/scripting/ejs')
-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) {