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: Fix bugs in libpq's management of GSS encryption state.
Date: Mon, 13 Jul 2020 15:58:31 +0000
Message-ID: <E1jv0qd-0002tE-7M@gemulon.postgresql.org> (raw)

Fix bugs in libpq's management of GSS encryption state.

GSS-related resources should be cleaned up in pqDropConnection,
not freePGconn, else the wrong things happen when resetting
a connection or trying to switch to a different server.
It's also critical to reset conn->gssenc there.

During connection setup, initialize conn->try_gss at the correct
place, else switching to a different server won't work right.

Remove now-redundant cleanup of GSS resources around one (and, for
some reason, only one) pqDropConnection call in connectDBStart.

Per report from Kyotaro Horiguchi that psql would freeze up,
rather than successfully resetting a GSS-encrypted connection
after a server restart.

This is YA oversight in commit b0b39f72b, so back-patch to v12.

Discussion: https://postgr.es/m/20200710.173803.435804731896516388.horikyota.ntt@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/25fe5ac45a736e50d2b85280a3cb0ce169f583f3

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



view thread (3+ messages)  latest in thread

Message-ID: <E1jv0qd-0002tE-7M@gemulon.postgresql.org>
Permalink:  ../E1jv0qd-0002tE-7M@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jv0qd-0002tE-7M@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix bugs in libpq's management of GSS encryption state.
  In-Reply-To: <E1jv0qd-0002tE-7M@gemulon.postgresql.org>
  References: <E1jv0qd-0002tE-7M@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