diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-08-23 02:05:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:34:23 -0500 |
commit | 185adae2f90ed187c7c4e0d415defb35b9c78722 (patch) | |
tree | 54f1ca1ff956772a8dd10c010980c5d105e36bc2 | |
parent | f5f18f2d1821c0edb4486c32555ed4a56daf6920 (diff) | |
download | samba-185adae2f90ed187c7c4e0d415defb35b9c78722.tar.gz samba-185adae2f90ed187c7c4e0d415defb35b9c78722.tar.bz2 samba-185adae2f90ed187c7c4e0d415defb35b9c78722.zip |
r9499: added error checking to the userAuth() call. SWAT is still failing, but at least it now
tells us why
(This used to be commit 4afb16d7b24b1d1ed359048a89950924b363e44a)
-rw-r--r-- | source4/scripting/ejs/smbcalls_auth.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c index 37ac9543cc..06d17ed01a 100644 --- a/source4/scripting/ejs/smbcalls_auth.c +++ b/source4/scripting/ejs/smbcalls_auth.c @@ -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); |