https://bugs.winehq.org/show_bug.cgi?id=56400
Bug ID: 56400 Summary: SSPI authentication does not work when connecting to sql server Product: Wine Version: 9.3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: secur32 Assignee: wine-bugs@winehq.org Reporter: alex.pesikin@gmail.com Distribution: ---
Created attachment 76152 --> https://bugs.winehq.org/attachment.cgi?id=76152 winedebug log
I have kubuntu 22.04 in the AD domain, via sssd. When I try connect through windows auth in my app to postgresql server running on windows, i have error "SSPI continuation error: SSPI error 80090318" how to reproduce via pg utils: -install pg command tools (in the example I used the postgresql-10.22-1-windows.exe installation) -go to pg installation directory and run psql.exe: wine cmd cd c:\program files\postgresql\10\bin c:\program files\postgresql\10\bin>psql.exe -h dc1.es9.loc -U avp@ES9.loc -d postgres 012c:err:winediag:ntlm_check_version ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution. 012c:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems 012c:fixme:kerberos:kerberos_SpInitLsaModeContext flags 0x100 not supported psql: SSPI continuation error: SSPI error 80090318 012c:fixme:msvcrt:__clean_type_info_names_internal (1003A65C) stub 012c:fixme:msvcrt:__clean_type_info_names_internal (78E94A54) stub 012c:fixme:msvcrt:__clean_type_info_names_internal (78DF7E14) stub
Debug log of command WINEDEBUG=+netapi32,+kerberos,+secur32,+ntlm wine psql.exe -h dc1.es9.loc -U avp@ES9.LOC in attachment. Native linux version of psql work perfectly: psql -h dc1.es9.loc -U avp@ES9.LOC -d postgres psql (14.11 (Ubuntu 14.11-0ubuntu0.22.04.1), server 13.6) Type "help" for help. postgres=#
https://bugs.winehq.org/show_bug.cgi?id=56400
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #1 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to AP from comment #0)
012c:err:winediag:ntlm_check_version ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution. 012c:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
While the messages above are probably harmless in this particular config it's strongly advised to pay attention to the messages, and the suggestion.
012c:fixme:kerberos:kerberos_SpInitLsaModeContext flags 0x100 not supported
0x100 is ISC_REQ_ALLOCATE_MEMORY.
psql: SSPI continuation error: SSPI error 80090318
According to the attached log SEC_E_INCOMPLETE_MESSAGE (80090318) is returned because passed buffer for a tocken has length 0. Probably ISC_REQ_ALLOCATE_MEMORY indicates that memory for the token should be allocated.
https://bugs.winehq.org/show_bug.cgi?id=56400
--- Comment #2 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 76153 --> https://bugs.winehq.org/attachment.cgi?id=76153 patch
Does the attached patch help?
https://bugs.winehq.org/show_bug.cgi?id=56400
--- Comment #3 from AP alex.pesikin@gmail.com --- thanks, I'll try to compile wine and let you know
https://bugs.winehq.org/show_bug.cgi?id=56400
--- Comment #4 from AP alex.pesikin@gmail.com --- Now output is like this (wine-9.3-194-gc1b8db0c28a): psql.exe -h dc1.es9.loc -U avp@ES9.LOC -d postgres 01c0:err:winediag:ntlm_check_version ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution. 01c0:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems psql: SSPI continuation error: SSPI error 80090318 01c0:fixme:msvcrt:__clean_type_info_names_internal (1003A65C) stub 01c0:fixme:msvcrt:__clean_type_info_names_internal (7BFE4A54) stub 01c0:fixme:msvcrt:__clean_type_info_names_internal (7BF47E14) stub
https://bugs.winehq.org/show_bug.cgi?id=56400
--- Comment #5 from AP alex.pesikin@gmail.com --- Created attachment 76158 --> https://bugs.winehq.org/attachment.cgi?id=76158 new winedebug log
https://bugs.winehq.org/show_bug.cgi?id=56400
--- Comment #6 from Hans Leidekker hans@meelstraat.net --- (In reply to AP from comment #5)
Created attachment 76158 [details] new winedebug log
The patch allocates memory for the input buffer but ISC_REQ_ALLOCATE_MEMORY is about allocating output buffers.
https://bugs.winehq.org/show_bug.cgi?id=56400
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #76153|0 |1 is obsolete| |
--- Comment #7 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 76159 --> https://bugs.winehq.org/attachment.cgi?id=76159 patch v2
Hans is correct, here is fixed version of the patch.
https://bugs.winehq.org/show_bug.cgi?id=56400
--- Comment #8 from AP alex.pesikin@gmail.com --- Now it works! (log in attach)
https://bugs.winehq.org/show_bug.cgi?id=56400
--- Comment #9 from AP alex.pesikin@gmail.com --- Created attachment 76165 --> https://bugs.winehq.org/attachment.cgi?id=76165 psql sspi success
https://bugs.winehq.org/show_bug.cgi?id=56400
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |7c7702f91df1fab6e4137d191c3 | |d08a32cdf4bc5
--- Comment #10 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to AP from comment #8)
Now it works! (log in attach)
Thanks for testing.
The fix committed as 7c7702f91df1fab6e4137d191c3d08a32cdf4bc5.
https://bugs.winehq.org/show_bug.cgi?id=56400
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.5.
https://bugs.winehq.org/show_bug.cgi?id=56400
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |9.0.x