Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXAqd-0002Yh-Nj for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Sep 2022 00:29:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXAqb-0002ne-9U for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Sep 2022 00:29:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXAqZ-0002nV-Gw for pgsql-hackers@lists.postgresql.org; Sun, 11 Sep 2022 00:29:16 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXAqR-0000ej-6L for pgsql-hackers@lists.postgresql.org; Sun, 11 Sep 2022 00:29:13 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 8A72332007BE; Sat, 10 Sep 2022 20:29:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 10 Sep 2022 20:29:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1662856143; x=1662942543; bh=zZQHvJ8SxV R8/RWBbpecj7eZx9CGvirOfoT0tQVMmN4=; b=VfhvncH2hs1ZzDkUxZVYy6ncfP gllkLDuKz1O1eXFx7ZmE0Uu2kS1T6tB0lrC5wwWCgQsSO/diJdIZ2Jmirgl2sORO 2o0I7wvbKax8U+snamkSTnm1a3RXUSaod4Rse6JNufNcZWR6Da1z49zTcXTEAhPC OeN1KnMN8dtFbO/Ot5jjd8RKtsgaeo2qzdjlpNaVtHk63fyUqWQnDzqAq3IT6AoN 4S5fuMOX111Pby8m2F1Z1QUGis1i8VxBpbHd6qhtJ+ULCVsFK4xvuq8EQo9TpZtP k6XinCve2irZeE4/oJ6b2LppDv8G+E1Gew3nZOMEoKwRv4xSSvZN+PFswmAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1662856143; x=1662942543; bh=zZQHvJ8SxVR8/RWBbpecj7eZx9CG virOfoT0tQVMmN4=; b=gTcbip5gpHhOWsaPUc91vjezjHEeN4rZn+o3GScQ60t6 1xs0g0pjGkSQX2WgHeq3mfeyqbRigLxKbVaE6CK1j4G82TwPEXdgPLRkgxl/JQXs dfnUV8xRQmjoxt70i5cDeETcRQJVgSCM7h3DFWU3go3AKgOecSY+UxHvE78k46Ur 7CBdS78bgVpS/oRcHIXoK9WplrxD5jZU5WsTLamQZuJAyj8FhI7i36hcqBmz+fn8 cA/SuIkf4TdoT6cFYcbaMRPnEfBMXeCb2vGBuICs6VoY2xA4gVfKp7n1DSTFnhYH zb9Fl1WS9e8N/0dlDE/BXg67AilvsoI+34dmD7LG3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedtkedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Sep 2022 20:28:58 -0400 (EDT) Date: Sun, 11 Sep 2022 09:28:54 +0900 From: Michael Paquier To: Justin Pryzby Cc: Thomas Munro , Andrew Dunstan , Daniel Gustafsson , Juan =?iso-8859-1?Q?Jos=E9_Santamar=EDa?= Flecha , pgsql-hackers@lists.postgresql.org Subject: Re: Bump MIN_WINNT to 0x0600 (Vista) as minimal runtime in 16~ Message-ID: References: <20220826112637.GD2342@telsasoft.com> <20220908132920.GG31833@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6KnxstKkAH4F9uwY" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6KnxstKkAH4F9uwY Content-Type: multipart/mixed; boundary="V2kEJ1f8WIr4Qd9O" Content-Disposition: inline --V2kEJ1f8WIr4Qd9O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --V2kEJ1f8WIr4Qd9O Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="win32-ldap-funccall.patch" Content-Transfer-Encoding: quoted-printable 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 =20 -/* 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 =20 static int CheckLDAPAuth(Port *port); @@ -2348,48 +2340,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap) #ifndef WIN32 if ((r =3D ldap_start_tls_s(*ldap, NULL, NULL)) !=3D LDAP_SUCCESS) #else - static __ldap_start_tls_sA _ldap_start_tls_sA =3D NULL; - - if (_ldap_start_tls_sA =3D=3D 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 =3D LoadLibrary("WLDAP32.DLL"); - if (ldaphandle =3D=3D 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 =3D (__ldap_start_tls_sA) (pg_funcptr_t) GetProcAddr= ess(ldaphandle, "ldap_start_tls_sA"); - if (_ldap_start_tls_sA =3D=3D 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 =3D _ldap_start_tls_sA(*ldap, NULL, NULL, NULL, NULL)) !=3D LDAP_= SUCCESS) + if ((r =3D ldap_start_tls_sA(*ldap, NULL, NULL, NULL, NULL)) !=3D LDAP_S= UCCESS) #endif { ereport(LOG, --V2kEJ1f8WIr4Qd9O-- --6KnxstKkAH4F9uwY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmMdK8YACgkQnvQgOdby QH1c/RAAlTMNkBRzvY39WCpiJ1ILj20PzmQhgXn3HxPMSNYnZHOHNcoo+ZNxx2DQ 4CwauYPaFEd/12Os2/9NQQStc+MVLyCqz5KDDZ6Z0+YI5F3BiXLEOixaewggyqnF T7ir3aaRRPh8LcHLPAiMdGC/bG43Mg5MeO0GfdmpCW888HtC9nDBr7x1xRzZYSTO FQLInM7zuHLAxqCzTdyAckL13YTGt5t+WFd53O9WGyB7tG7AdTKyanJ5XT/PC1gp 4Qjhc24bcBYbzYuT8bpto4/XE+ku+B6Ut4WIlJKS1PXhsRTX8nlxvj85CHQWVT41 4aMKVEL2fss5ftLck/whm/XD5XjOiqLDqgonUpVOGJKb0uLM0VB82xy+CqxiC4of zydPpQShPrABEwVRdF5lGzmD6vuXCAu88pFNEnrJz+PlZwVdMfxlCDARYGV3Ilhd v5ctDUf8Wv391slxI/eX1POFwlpg5vT2w4e59HNnz/kbZVPws9eW9Vf3qRjxOoWv sXsDP2bOFUE1SBE2K9dFgt8Q9a+GSu0aF42VHcWcQNUN3jd8wnSFbdr+20HWXbXU d0XC8svuTtJLZDaYZgrS3qYrwPErYO0CQ5mvEdT4RAgMD3V7CMvLVxLMzNUWSvkK pRe5CfVetc6RPxplzfLi+bH/BmzlaYj/6MlBzNL+0pifMEDSNJQ= =L/45 -----END PGP SIGNATURE----- --6KnxstKkAH4F9uwY--