https://bugs.winehq.org/show_bug.cgi?id=54724
Bug ID: 54724 Summary: LDAP bind over SSL to a server and port that do not support SSL hangs forever Product: Wine Version: 7.22 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: wldap32 Assignee: wine-bugs@winehq.org Reporter: alexhenrie24@gmail.com Distribution: ---
Created attachment 74229 --> https://bugs.winehq.org/attachment.cgi?id=74229 Test program
To reproduce, compile and run the attached program with:
x86_64-w64-mingw32-cc ldap.c -lwldap32 -o ldap.exe wine ldap.exe
The bind fails, but before Wine 7.22 an error code was returned instead of the bind function hanging forever. `git bisect` says:
d08d6f51040e18982612658a885af659fbfa4afe is the first bad commit commit d08d6f51040e18982612658a885af659fbfa4afe Author: Hans Leidekker hans@codeweavers.com Date: Tue Sep 20 13:06:43 2022 +0200
wldap32: Use the bundled liblber and libldap.
configure | 198 ++--------- configure.ac | 29 +- dlls/wldap32/Makefile.in | 7 +- dlls/wldap32/add.c | 15 +- dlls/wldap32/ber.c | 166 ++++----- dlls/wldap32/bind.c | 161 ++++----- dlls/wldap32/compare.c | 33 +- dlls/wldap32/control.c | 34 +- dlls/wldap32/delete.c | 15 +- dlls/wldap32/dn.c | 55 +-- dlls/wldap32/error.c | 91 +++-- dlls/wldap32/extended.c | 38 +- dlls/wldap32/init.c | 18 +- dlls/wldap32/libldap.c | 683 ------------------------------------ dlls/wldap32/libldap.h | 624 --------------------------------- dlls/wldap32/main.c | 6 - dlls/wldap32/misc.c | 131 +++---- dlls/wldap32/modify.c | 23 +- dlls/wldap32/modrdn.c | 9 +- dlls/wldap32/option.c | 80 ++--- dlls/wldap32/page.c | 38 +- dlls/wldap32/parse.c | 88 ++--- dlls/wldap32/rename.c | 20 +- dlls/wldap32/search.c | 57 ++- dlls/wldap32/tests/ber.c | 2 +- dlls/wldap32/value.c | 40 +-- dlls/wldap32/winldap_private.h | 776 +++++++++++++++++++++++++++++------------ include/config.h.in | 12 - 28 files changed, 1087 insertions(+), 2362 deletions(-) delete mode 100644 dlls/wldap32/libldap.c delete mode 100644 dlls/wldap32/libldap.h
https://bugs.winehq.org/show_bug.cgi?id=54724
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |d08d6f51040e18982612658a885 | |af659fbfa4afe CC| |hans@meelstraat.net Keywords| |regression, source
https://bugs.winehq.org/show_bug.cgi?id=54724
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |9af7faca7cadc706dcb4d0842e9 | |09f8f272dbccd Status|NEW |RESOLVED
--- Comment #1 from Hans Leidekker hans@meelstraat.net --- This should be fixed with 9af7faca7cadc706dcb4d0842e909f8f272dbccd.
https://bugs.winehq.org/show_bug.cgi?id=54724
--- Comment #2 from Alex Henrie alexhenrie24@gmail.com --- Created attachment 74234 --> https://bugs.winehq.org/attachment.cgi?id=74234 Test program for OpenLDAP
Thanks Hans! That was fast. Although I am glad that the bug is fixed now, I am actually not sure that patching OpenLDAP was the ideal way to fix it. I can compile and run the attached test program on Windows with Cygwin, and it does not hang. That makes me suspect that OpenLDAP handles this situation just fine on Windows, and there is something wrong with Wine that is breaking it. Do you have any idea what the underlying problem might be?
https://bugs.winehq.org/show_bug.cgi?id=54724
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #74229|text/x-csrc |text/plain mime type| | Attachment #74229|Test program |Test program for WinLDAP description| |
https://bugs.winehq.org/show_bug.cgi?id=54724
--- Comment #3 from Alex Henrie alexhenrie24@gmail.com --- Wait a minute: tls_w.c says "Copyright 2008-2022 The OpenLDAP Foundation" but I can't find it in the OpenLDAP Git repository at https://git.openldap.org/openldap/openldap. Where did that file come from? Was it written specifically for Wine?
https://bugs.winehq.org/show_bug.cgi?id=54724
--- Comment #4 from Hans Leidekker hans@meelstraat.net --- (In reply to Alex Henrie from comment #3)
Wait a minute: tls_w.c says "Copyright 2008-2022 The OpenLDAP Foundation" but I can't find it in the OpenLDAP Git repository at https://git.openldap.org/openldap/openldap. Where did that file come from? Was it written specifically for Wine?
Yes, I wrote it to replace the OpenSSL/GnutTLS backends which would have required us to build one of those as PE. Another reason is that using SSPI integrates with Windows settings w.r.t. certificate verification, allowed protocol versions and so on.
I hope to upstream it at some point.
https://bugs.winehq.org/show_bug.cgi?id=54724
--- Comment #5 from Alex Henrie alexhenrie24@gmail.com --- Thanks for the explanation, it makes total sense now why Wine would want to have a native TLS backend for OpenLDAP. Is the intent to transfer the copyright to the OpenLDAP Foundation when tls_w.c is upstreamed? If not, I'd like to change the file to say "Copyright 2022-2023 Hans Leidekker for CodeWeavers" instead so that no one else is confused about where the code came from.
https://bugs.winehq.org/show_bug.cgi?id=54724
--- Comment #6 from Hans Leidekker hans@meelstraat.net --- (In reply to Alex Henrie from comment #5)
Thanks for the explanation, it makes total sense now why Wine would want to have a native TLS backend for OpenLDAP. Is the intent to transfer the copyright to the OpenLDAP Foundation when tls_w.c is upstreamed? If not, I'd like to change the file to say "Copyright 2022-2023 Hans Leidekker for CodeWeavers" instead so that no one else is confused about where the code came from.
I'm not decided yet about copyright assignment. The file shouldn't be fully credited to me either because I based it on tls_g.c.
This MR shows all the changes I made to upstream:
https://gitlab.winehq.org/wine/wine/-/merge_requests/912
https://bugs.winehq.org/show_bug.cgi?id=54724
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.5.
https://bugs.winehq.org/show_bug.cgi?id=54724
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |8.0.x
https://bugs.winehq.org/show_bug.cgi?id=54724
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|8.0.x |---
--- Comment #8 from Michael Stefaniuc mstefani@winehq.org --- Removing the 8.0.x milestone from bug fixes included in 8.0.2.