I'm using apache 2.4 (on linux) with mod_auth_ntlm_winbind to do authentication in a windows environment. I've noticed that sometimes, the username returned by mod_auth_ntlm_winbind is corrupted, even though the authentication itself succeeds. I've done some debugging and I think I found the cause. In source3/utils/ntlm_auth.c, in the function manage_gensec_request, near line 1681: ... } else { reply_code = "AF"; reply_arg = session_info->unix_info->unix_name; talloc_free(session_info); } ... case GSS_SPNEGO_SERVER: x_fprintf(x_stdout, "%s %s %s\n", reply_code, out_base64 ? out_base64 : "*", reply_arg ? reply_arg : "*"); I think the problem is that session_info->unix_info->unix_name (via reply_arg) is being used after it's been freed. I've hacked the source on my system to do char replyArgBuffer[80]; /* somewhere near the beginning of the function */ ... } else { reply_code = "AF"; strncpy(replyArgBuffer, session_info->unix_info->unix_name, sizeof(replyArgBuffer)); reply_arg = replyArgBuffer; talloc_free(session_info); } and that seems to have fixed the problem.
A patch has been accepted (to master) to corrected this issue. 6bf9a774718917c3429fa1492f5b0268ae5e01c3
I think we should get this in the 4.x release branches, too. git cherry-pick -x 6bf9a774718917c3429fa1492f5b0268ae5e01c3 cleanly applies to v4-0-test and v4-1-test.
LGTM. Karolin please pick for 4.0.next and 4.1.next. Jeremy.
Pushed to autobuild-v4-1-test and autobuild-v4-0-test.
(In reply to comment #4) > Pushed to autobuild-v4-1-test and autobuild-v4-0-test. Pushed to v4-1-test. Autobuild-v4-0-test failed, re-trying...
(In reply to comment #5) > (In reply to comment #4) > > Pushed to autobuild-v4-1-test and autobuild-v4-0-test. > > Pushed to v4-1-test. > Autobuild-v4-0-test failed, re-trying... Autobuild-v4-0-test failed again, re-trying...
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > Pushed to autobuild-v4-1-test and autobuild-v4-0-test. > > > > Pushed to v4-1-test. > > Autobuild-v4-0-test failed, re-trying... > > Autobuild-v4-0-test failed again, re-trying... Pushed to v4-0-test. Closing out bug report. Thanks!