From 0f35d51ab65b974d3362e0b6f7ebff7b41fb5835 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 3 Sep 2010 16:15:27 +0200 Subject: [PATCH] s4:auth_winbind: fix segfault in winbind_check_password_wbclient() We should only look at err if WBC_ERR_AUTH_ERROR is returned. metze --- source4/auth/ntlm/auth_winbind.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source4/auth/ntlm/auth_winbind.c b/source4/auth/ntlm/auth_winbind.c index f680bcbf7fe..06be4fc9132 100644 --- a/source4/auth/ntlm/auth_winbind.c +++ b/source4/auth/ntlm/auth_winbind.c @@ -392,13 +392,17 @@ static NTSTATUS winbind_check_password_wbclient(struct auth_method_context *ctx, user_info->password.response.nt.data; wbc_status = wbcAuthenticateUserEx(¶ms, &info, &err); - if (!WBC_ERROR_IS_OK(wbc_status)) { + if (wbc_status == WBC_ERR_AUTH_ERROR) { DEBUG(1, ("error was %s (0x%08x)\nerror message was '%s'\n", err->nt_string, err->nt_status, err->display_string)); nt_status = NT_STATUS(err->nt_status); wbcFreeMemory(err); NT_STATUS_NOT_OK_RETURN(nt_status); + } else if (!WBC_ERROR_IS_OK(wbc_status)) { + DEBUG(1, ("wbcAuthenticateUserEx: failed with %u - %s\n", + wbc_status, wbcErrorString(wbc_status))); + return NT_STATUS_LOGON_FAILURE; } nt_status = get_info3_from_wbcAuthUserInfo(mem_ctx, info, &info3); wbcFreeMemory(info); -- 2.11.4.GIT