wbinfo: ask wbcAuthenticateUserEx() for user info to test the more complex code path
authorStefan Metzmacher <metze@samba.org>
Fri, 15 Feb 2008 09:40:43 +0000 (10:40 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 15 Feb 2008 10:55:17 +0000 (11:55 +0100)
metze

source/nsswitch/wbinfo.c

index 689dc5e9e10d6bf32367d0120e404d4918cdd611..ee51cce8359004dcce660eab60d12195e2b713bc 100644 (file)
@@ -906,6 +906,7 @@ static bool wbinfo_auth_crap(char *username)
 {
        wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
        struct wbcAuthUserParams params;
+       struct wbcAuthUserInfo *info = NULL;
        struct wbcAuthErrorInfo *err = NULL;
        DATA_BLOB lm = data_blob_null;
        DATA_BLOB nt = data_blob_null;
@@ -974,7 +975,7 @@ static bool wbinfo_auth_crap(char *username)
        params.password.response.lm_length      = lm.length;
        params.password.response.lm_data        = lm.data;
 
-       wbc_status = wbcAuthenticateUserEx(&params, NULL, &err);
+       wbc_status = wbcAuthenticateUserEx(&params, &info, &err);
 
        /* Display response */
 
@@ -987,6 +988,8 @@ static bool wbinfo_auth_crap(char *username)
                         err->nt_status,
                         err->display_string);
                wbcFreeMemory(err);
+       } else if (WBC_ERROR_IS_OK(wbc_status)) {
+               wbcFreeMemory(info);
        }
 
        data_blob_free(&nt);