summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/ejs/smbcalls_ldb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/scripting/ejs/smbcalls_ldb.c b/source4/scripting/ejs/smbcalls_ldb.c
index 7c81b8c826..e9dba94eaa 100644
--- a/source4/scripting/ejs/smbcalls_ldb.c
+++ b/source4/scripting/ejs/smbcalls_ldb.c
@@ -360,6 +360,8 @@ static int ejs_ldbConnect(MprVarHandle eid, int argc, char **argv)
struct ldb_context *ldb;
struct auth_session_info *session_info;
struct cli_credentials *creds;
+ struct MprVar *credentials;
+ struct MprVar *this = mprGetProperty(ejsGetLocalObject(eid), "this", 0);
const char *dbfile;
@@ -370,8 +372,10 @@ static int ejs_ldbConnect(MprVarHandle eid, int argc, char **argv)
session_info = mprGetThisPtr(eid, "session_info");
- creds = mprGetThisPtr(eid, "credentials");
- if (creds == NULL) {
+ credentials = mprGetProperty(this, "credentials", NULL);
+ if (credentials) {
+ creds = mprGetPtr(credentials, "creds");
+ } else {
creds = cmdline_credentials;
}