pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Cope with a deficiency in OpenSSL 3.x's error reporting.
Date: Fri, 08 Mar 2024 00:38:29 +0000
Message-ID: <E1riOFp-002dPb-3q@gemulon.postgresql.org> (raw)

Cope with a deficiency in OpenSSL 3.x's error reporting.

In OpenSSL 3.0.0 and later, ERR_reason_error_string randomly refuses
to provide a string for error codes representing system errno values
(e.g., "No such file or directory").  There is a poorly-documented way
to extract the errno from the SSL error code in this case, so do that
and apply strerror, rather than falling back to reporting the error
code's numeric value as we were previously doing.

Problem reported by David Zhang, although this is not his proposed
patch; it's instead based on a suggestion from Heikki Linnakangas.
Back-patch to all supported branches, since any of them are likely
to be used with recent OpenSSL.

Discussion: https://postgr.es/m/b6fb018b-f05c-4afd-abd3-318c649faf18@highgo.ca

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0fe82e45cbedbe840f00d834cc6cae55593ef8cf

Modified Files
--------------
src/backend/libpq/be-secure-openssl.c    | 19 ++++++++++++++++---
src/interfaces/libpq/fe-secure-openssl.c | 23 ++++++++++++++++++++---
2 files changed, 36 insertions(+), 6 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1riOFp-002dPb-3q@gemulon.postgresql.org>
Permalink:  ../E1riOFp-002dPb-3q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1riOFp-002dPb-3q@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Cope with a deficiency in OpenSSL 3.x's error reporting.
  In-Reply-To: <E1riOFp-002dPb-3q@gemulon.postgresql.org>

* 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