Prevent a segfault when "wbinfo -a" is called without password.
authorMichael Adam <obnox@samba.org>
Mon, 4 Feb 2008 16:07:54 +0000 (17:07 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 4 Feb 2008 16:27:54 +0000 (17:27 +0100)
wbcAuthenticateUser segfaults when passed NULL as password.
This only changes the caller in wbinfo.c to pass an empty
password string to wbcAuthenticateUser().

Michael
(This used to be commit 3cbc7c19eba68427160e09e865edc85c7fe38413)

source3/nsswitch/wbinfo.c

index 3410668fcd445b40fad45964fd2d8faab5411ace..c13b4b64e05826e3e26958b1f0343dbb0ff2f0a8 100644 (file)
@@ -875,10 +875,12 @@ static bool wbinfo_auth(char *username)
        if ((p = strchr(s, '%')) != NULL) {
                 *p = 0;
                p++;
+               password = p;
+       } else {
+               password = "";
        }
 
        name = s;
-       password = p;   
 
        wbc_status = wbcAuthenticateUser(name, password);