pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: 近藤雄太 <kondo@sraoss.co.jp>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: buildfarm@sraoss.co.jp
Subject: Re: Missing include <openssl/x509.h> in be-secure-openssl.c?
Date: Thu, 04 Nov 2021 09:54:07 -0400
Message-ID: <319425.1636034047@sss.pgh.pa.us> (raw)
In-Reply-To: <YYON2JtkHZfYArY/@paquier.xyz>
References: <461EF47A-C979-4124-87E3-758A68A98D1E@yesql.se>
	<YYBpstjmTv2xbc74@paquier.xyz>
	<1790342.1635950136@sss.pgh.pa.us>
	<20211104105613.d97d4434e1adb2495f428b72@sraoss.co.jp>
	<YYNChzE3FUi+PKhT@paquier.xyz>
	<CA+hUKG+VfJ6g4JoHpdFKVcpsT7o5GQy_74uGPethXQDSYnkcEQ@mail.gmail.com>
	<CA+hUKG+5k2n1FTgtts+KONheRz3NVtfQsePU_da9cr0TU5dH-Q@mail.gmail.com>
	<284247.1635996826@sss.pgh.pa.us>
	<CA+hUKGKZiYKHqGQr+zQFQ0=BdOzxBmXgpvi3cN_BZ1kmHZKs8Q@mail.gmail.com>
	<284929.1635997526@sss.pgh.pa.us>
	<YYON2JtkHZfYArY/@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Nov 03, 2021 at 11:45:26PM -0400, Tom Lane wrote:
>> Yeah, I noted the comment about WIN32_LEAN_AND_MEAN in the
>> stackoverflow thread too ... but as you say, it seems like
>> that should make the problem less probable not more so.
>> Still, it's hard to think of any other relevant change.

> Yeah, I don't see how this could be linked to WIN32_LEAN_AND_MEAN.

According to that stackoverflow thread, the unwanted #define of
X509_NAME comes from <wincrypt.h>, and WIN32_LEAN_AND_MEAN
prevents that from being immediately included by <windows.h>.

The rough idea I have is that prior to 8162464a2, we sucked in
that #define during postgres.h and then OpenSSL's headers were
able to undo it.  After 8162464a2, we don't read <wincrypt.h>
during postgres.h, but some *other* header that be-secure-openssl.c
is including after the OpenSSL headers is pulling it in, so that
by the time we get to the body of the file the unwanted #define
is active.

I don't have either the resources or the interest to track down
exactly where that happens; my thought was just to make
be-secure-openssl.c's inclusions look more like fe-secure-openssl.c.
But, if you'd like to pursue the details, feel free.

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <319425.1636034047@sss.pgh.pa.us>
Permalink:  ../319425.1636034047@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/319425.1636034047@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, thomas.munro@gmail.com, kondo@sraoss.co.jp, daniel@yesql.se, buildfarm@sraoss.co.jp
  Subject: Re: Missing include <openssl/x509.h> in be-secure-openssl.c?
  In-Reply-To: <319425.1636034047@sss.pgh.pa.us>
  References: <461EF47A-C979-4124-87E3-758A68A98D1E@yesql.se> <YYBpstjmTv2xbc74@paquier.xyz> <1790342.1635950136@sss.pgh.pa.us> <20211104105613.d97d4434e1adb2495f428b72@sraoss.co.jp> <YYNChzE3FUi+PKhT@paquier.xyz> <CA+hUKG+VfJ6g4JoHpdFKVcpsT7o5GQy_74uGPethXQDSYnkcEQ@mail.gmail.com> <CA+hUKG+5k2n1FTgtts+KONheRz3NVtfQsePU_da9cr0TU5dH-Q@mail.gmail.com> <284247.1635996826@sss.pgh.pa.us> <CA+hUKGKZiYKHqGQr+zQFQ0=BdOzxBmXgpvi3cN_BZ1kmHZKs8Q@mail.gmail.com> <284929.1635997526@sss.pgh.pa.us> <YYON2JtkHZfYArY/@paquier.xyz> <319425.1636034047@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox