summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {