pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix inconsistent error handling for GSS encryption in PQconnectP
Date: Mon, 13 Mar 2023 07:37:06 +0000
Message-ID: <E1pbcjx-003IIE-Ix@gemulon.postgresql.org> (raw)

Fix inconsistent error handling for GSS encryption in PQconnectPoll()

The error cases for TLS and GSS encryption were inconsistent.  After TLS
fails, the connection is marked as dead and follow-up calls of
PQconnectPoll() would return immediately, but GSS encryption was not
doing that, so the connection would still have been allowed to enter the
GSS handling code.  This was handled incorrectly when gssencmode was set
to "require".  "prefer" was working correctly, and this could not happen
under "disable" as GSS encryption would not be attempted.

This commit makes the error handling of GSS encryption on par with TLS
portion, fixing the case of gssencmode=require.

Reported-by: Jacob Champion
Author: Michael Paquier
Reviewed-by: Jacob Champion, Stephen Frost
Discussion: https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4713@timescale.com
Backpatch-through: 12

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7e319231c6bba7bad4a71a47ed0aefadf71e1103

Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1pbcjx-003IIE-Ix@gemulon.postgresql.org>
Permalink:  ../E1pbcjx-003IIE-Ix@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pbcjx-003IIE-Ix@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 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-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix inconsistent error handling for GSS encryption in PQconnectP
  In-Reply-To: <E1pbcjx-003IIE-Ix@gemulon.postgresql.org>
  References: <E1pbcjx-003IIE-Ix@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