r12323: fixeed the use of options.get_credentials() for ldb
authorAndrew Tridgell <tridge@samba.org>
Sun, 18 Dec 2005 22:27:26 +0000 (22:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:29 +0000 (13:47 -0500)
source/scripting/ejs/smbcalls_ldb.c

index 7c81b8c826a5578262f0f15c628e8ee536873cb8..e9dba94eaa40b6d818eaf8988ad8e2f9e257b60a 100644 (file)
@@ -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;
        }