summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-08 03:20:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:31 -0500
commit2b31c6d9d0d853d6be0a7e4f42977029389fc5ce (patch)
tree6ea3ca7432109d4c2252d1136d182076ea89ad11 /source4/scripting/ejs
parenta689b968b6c1b47b0425f753472f1e221d2dea67 (diff)
downloadsamba-2b31c6d9d0d853d6be0a7e4f42977029389fc5ce.tar.gz
samba-2b31c6d9d0d853d6be0a7e4f42977029389fc5ce.tar.bz2
samba-2b31c6d9d0d853d6be0a7e4f42977029389fc5ce.zip
r9210: fixed support for a credentials element in a rpc object in ejs to not
give lots of warnings of missing properties (This used to be commit 15737abd747cea561eca92103919f4adc22c6fcd)
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r--source4/scripting/ejs/mprutil.c9
-rw-r--r--source4/scripting/ejs/smbcalls_rpc.c7
2 files changed, 10 insertions, 6 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c
index 748f28c681..657078e7c7 100644
--- a/source4/scripting/ejs/mprutil.c
+++ b/source4/scripting/ejs/mprutil.c
@@ -357,14 +357,15 @@ void mprSetPtrChild(struct MprVar *v, const char *propname, const void *p)
*/
void *mprGetPtr(struct MprVar *v, const char *propname)
{
- NTSTATUS status = mprGetVar(&v, propname);
- if (!NT_STATUS_IS_OK(status)) {
+ struct MprVar *val;
+ val = mprGetProperty(v, propname, NULL);
+ if (val == NULL) {
return NULL;
}
- if (v->type != MPR_TYPE_PTR) {
+ if (val->type != MPR_TYPE_PTR) {
return NULL;
}
- return v->ptr;
+ return val->ptr;
}
/*
diff --git a/source4/scripting/ejs/smbcalls_rpc.c b/source4/scripting/ejs/smbcalls_rpc.c
index f5b71b6715..cbb8d9dd9d 100644
--- a/source4/scripting/ejs/smbcalls_rpc.c
+++ b/source4/scripting/ejs/smbcalls_rpc.c
@@ -112,6 +112,7 @@ static int ejs_rpc_connect(MprVarHandle eid, int argc, char **argv)
struct cli_credentials *creds;
struct event_context *ev;
struct MprVar *this = mprGetProperty(ejsGetLocalObject(eid), "this", 0);
+ struct MprVar *credentials;
/* validate arguments */
if (argc < 1) {
@@ -137,8 +138,10 @@ static int ejs_rpc_connect(MprVarHandle eid, int argc, char **argv)
goto done;
}
- creds = mprGetPtr(this, "credentials.creds");
- if (creds == NULL) {
+ credentials = mprGetProperty(this, "credentials", NULL);
+ if (credentials) {
+ creds = mprGetPtr(credentials, "creds");
+ } else {
creds = cmdline_credentials;
}
if (creds == NULL) {