From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_receivewal, pg_recvlogical: allow canceling initial password
Date: Sun, 21 Nov 2021 19:14:00 +0000
Message-ID: <E1mosHo-0000Wi-Rx@gemulon.postgresql.org> (raw)
pg_receivewal, pg_recvlogical: allow canceling initial password prompt.
Previously it was impossible to terminate these programs via control-C
while they were prompting for a password. We can fix that trivially
for their initial password prompts, by moving setup of the SIGINT
handler from just before to just after their initial GetConnection()
calls.
This fix doesn't permit escaping out of later re-prompts, but those
should be exceedingly rare, since the user's password or the server's
authentication setup would have to have changed meanwhile. We
considered applying a fix similar to commit 46d665bc2, but that
seemed more complicated than it'd be worth. Moreover, this way is
back-patchable, which that wasn't.
The misbehavior exists in all supported versions, so back-patch to all.
Tom Lane and Nathan Bossart
Discussion: https://postgr.es/m/747443.1635536754@sss.pgh.pa.us
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/3bd7556bbe0ade42552e3a094c3b0fd99039854e
Modified Files
--------------
src/bin/pg_basebackup/pg_receivewal.c | 12 ++++++++----
src/bin/pg_basebackup/pg_recvlogical.c | 22 ++++++++++++----------
2 files changed, 20 insertions(+), 14 deletions(-)
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: pg_receivewal, pg_recvlogical: allow canceling initial password
In-Reply-To: <E1mosHo-0000Wi-Rx@gemulon.postgresql.org>
References: <E1mosHo-0000Wi-Rx@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