public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Paquier <[email protected]>
To: Justin Pryzby <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: Daniel Gustafsson <[email protected]>
Cc: Juan José SantamarÃa Flecha <[email protected]>
Cc: [email protected]
Subject: Re: Bump MIN_WINNT to 0x0600 (Vista) as minimal runtime in 16~
Date: Sun, 11 Sep 2022 09:28:54 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<YsZnhwERsDv/[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CA+hUKG+BMdcaCe=P-EjMoLTCr3zrrzqbcVE=8h5LyNsSVHKXZA@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
On Fri, Sep 09, 2022 at 08:11:09PM +0900, Michael Paquier wrote:
> Based on what I can see, the Windows animals seem to have digested
> 47bd0b3 (cygwin, MinGW and MSVC), so I think that we are good.
The last part that's worth adjusting is ldap_start_tls_sA(), which
would lead to the attached simplification. The MinGW headers list
this routine, so like the previous change I think that it should be
safe for such builds.
Looking at the buildfarm animals, bowerbird, jacana, fairywren,
lorikeet and drongo disable ldap. hamerkop is the only member that
provides coverage for it, still that's a MSVC build.
The CI provides coverage for ldap as it is enabled by default and
windows_build_config.pl does not tell otherwise, but with the existing
animals we don't have ldap coverage under MinGW.
Anyway, I'd like to apply the attached, and I don't quite see why it
would not work after 47bd0b3 under MinGW. Any thoughts?
--
Michael
Attachments:
[text/x-diff] win32-ldap-funccall.patch (2.2K, ../[email protected]/2-win32-ldap-funccall.patch)
download | inline diff:
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index a776bc3ed7..3a10baa9ce 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -135,14 +135,6 @@ static int CheckBSDAuth(Port *port, char *user);
#else
#include <winldap.h>
-/* Correct header from the Platform SDK */
-typedef
-ULONG (*__ldap_start_tls_sA) (IN PLDAP ExternalHandle,
- OUT PULONG ServerReturnValue,
- OUT LDAPMessage **result,
- IN PLDAPControlA * ServerControls,
- IN PLDAPControlA * ClientControls
-);
#endif
static int CheckLDAPAuth(Port *port);
@@ -2348,48 +2340,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
#ifndef WIN32
if ((r = ldap_start_tls_s(*ldap, NULL, NULL)) != LDAP_SUCCESS)
#else
- static __ldap_start_tls_sA _ldap_start_tls_sA = NULL;
-
- if (_ldap_start_tls_sA == NULL)
- {
- /*
- * Need to load this function dynamically because it may not exist
- * on Windows, and causes a load error for the whole exe if
- * referenced.
- */
- HANDLE ldaphandle;
-
- ldaphandle = LoadLibrary("WLDAP32.DLL");
- if (ldaphandle == NULL)
- {
- /*
- * should never happen since we import other files from
- * wldap32, but check anyway
- */
- ereport(LOG,
- (errmsg("could not load library \"%s\": error code %lu",
- "WLDAP32.DLL", GetLastError())));
- ldap_unbind(*ldap);
- return STATUS_ERROR;
- }
- _ldap_start_tls_sA = (__ldap_start_tls_sA) (pg_funcptr_t) GetProcAddress(ldaphandle, "ldap_start_tls_sA");
- if (_ldap_start_tls_sA == NULL)
- {
- ereport(LOG,
- (errmsg("could not load function _ldap_start_tls_sA in wldap32.dll"),
- errdetail("LDAP over SSL is not supported on this platform.")));
- ldap_unbind(*ldap);
- FreeLibrary(ldaphandle);
- return STATUS_ERROR;
- }
-
- /*
- * Leak LDAP handle on purpose, because we need the library to
- * stay open. This is ok because it will only ever be leaked once
- * per process and is automatically cleaned up on process exit.
- */
- }
- if ((r = _ldap_start_tls_sA(*ldap, NULL, NULL, NULL, NULL)) != LDAP_SUCCESS)
+ if ((r = ldap_start_tls_sA(*ldap, NULL, NULL, NULL, NULL)) != LDAP_SUCCESS)
#endif
{
ereport(LOG,
[application/pgp-signature] signature.asc (833B, ../[email protected]/3-signature.asc)
download
view thread (32+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Bump MIN_WINNT to 0x0600 (Vista) as minimal runtime in 16~
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox