pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Magnus Hagander <magnus@hagander.net>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Date: Sun, 15 Nov 2020 12:16:56 -0500
Message-ID: <632623.1605460616@sss.pgh.pa.us> (raw)
In-Reply-To: <CABUevEwMa92UCWg2NDTr--0GGHimjGA5jWghm1BEnZ5qzEHmkQ@mail.gmail.com>
References: <666524FF-D807-4687-BBAA-E49A76F06239@yesql.se>
	<CABUevEzSKm9caQzTgN1WTWiwUTEECZhB+TxBC6RUD2vic7Wrvg@mail.gmail.com>
	<20201104010114.GA1711@paquier.xyz>
	<CABUevEybbYkJ7kQu5mOgbgYvFq4OtEDqCWtkz3MPfAD6XBsezg@mail.gmail.com>
	<20201105034413.GE1632@paquier.xyz>
	<C530001E-EFCA-4B04-98A6-AF8887A55C34@yesql.se>
	<20201105121253.GA17513@paquier.xyz>
	<7001EB35-BF76-4DEA-A7AB-CA94BCAA64E3@yesql.se>
	<20201105122834.GB17513@paquier.xyz>
	<8D9C19AD-674D-4FD2-820E-9B429053719E@yesql.se>
	<20201105233632.GA21123@paquier.xyz>
	<53D01523-A458-4FC6-83F1-8A16266F54A0@yesql.se>
	<CABUevEwMa92UCWg2NDTr--0GGHimjGA5jWghm1BEnZ5qzEHmkQ@mail.gmail.com>

Magnus Hagander <magnus@hagander.net> writes:
> I think the defensive-in-code instead of defensive-in-docs is a really
> strong argument, so I have pushed it as such.

I notice warnings that I think are caused by this patch on some buildfarm
members, eg

 drongo        | 2020-11-15 06:59:05 | C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning C4013: 'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\postgres.vcxproj]
 drongo        | 2020-11-15 06:59:05 | C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning C4013: 'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\libpgport.vcxproj]
 drongo        | 2020-11-15 06:59:05 |   C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning C4013: 'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\postgres.vcxproj]
 drongo        | 2020-11-15 06:59:05 |   C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning C4013: 'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\libpgport.vcxproj]

(bowerbird and hamerkop are showing the same).

My first thought about it was that this bit is busted:

+#ifndef USE_OPENSSL
+   RAND_poll();
+#endif

The obvious problem with this is that if !USE_OPENSSL, we will not have
pulled in openssl's headers.

However ... all these machines are pointing at line 96, which is not
that one but the one under "#if defined(USE_OPENSSL)".  So I'm not sure
what to make of that, except that a bit more finesse seems required.

			regards, tom lane





view thread (38+ messages)  latest in thread

Message-ID: <632623.1605460616@sss.pgh.pa.us>
Permalink:  ../632623.1605460616@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/632623.1605460616@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, magnus@hagander.net, daniel@yesql.se, michael@paquier.xyz
  Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
  In-Reply-To: <632623.1605460616@sss.pgh.pa.us>
  References: <666524FF-D807-4687-BBAA-E49A76F06239@yesql.se> <CABUevEzSKm9caQzTgN1WTWiwUTEECZhB+TxBC6RUD2vic7Wrvg@mail.gmail.com> <20201104010114.GA1711@paquier.xyz> <CABUevEybbYkJ7kQu5mOgbgYvFq4OtEDqCWtkz3MPfAD6XBsezg@mail.gmail.com> <20201105034413.GE1632@paquier.xyz> <C530001E-EFCA-4B04-98A6-AF8887A55C34@yesql.se> <20201105121253.GA17513@paquier.xyz> <7001EB35-BF76-4DEA-A7AB-CA94BCAA64E3@yesql.se> <20201105122834.GB17513@paquier.xyz> <8D9C19AD-674D-4FD2-820E-9B429053719E@yesql.se> <20201105233632.GA21123@paquier.xyz> <53D01523-A458-4FC6-83F1-8A16266F54A0@yesql.se> <CABUevEwMa92UCWg2NDTr--0GGHimjGA5jWghm1BEnZ5qzEHmkQ@mail.gmail.com> <632623.1605460616@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