r9499: added error checking to the userAuth() call. SWAT is still failing, but at...
authorAndrew Tridgell <tridge@samba.org>
Tue, 23 Aug 2005 02:05:53 +0000 (02:05 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:34:23 +0000 (13:34 -0500)
tells us why
(This used to be commit 4afb16d7b24b1d1ed359048a89950924b363e44a)

source4/scripting/ejs/smbcalls_auth.c

index 37ac9543ccee35622886c43dfd5aa2f08301a432..06d17ed01a22a7b2d0fbc4e52de76a294611844c 100644 (file)
@@ -105,7 +105,7 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv)
        const char *password;
        const char *domain;
        const char *remote_host;
-       struct MprVar auth, *creds_obj;
+       struct MprVar auth;
        struct cli_credentials *creds;
 
        if (argc != 1 || argv[0]->type != MPR_TYPE_OBJECT) {
@@ -115,6 +115,10 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv)
 
        /* get credential values from credentials object */
        creds = mprGetPtr(argv[0], "creds");
+       if (creds == NULL) {
+               ejsSetErrorMsg(eid, "userAuth requires a 'creds' element");
+               return -1;
+       }
        username    = cli_credentials_get_username(creds);
        password    = cli_credentials_get_password(creds);
        domain      = cli_credentials_get_domain(creds);