pgsql: pg_receivewal, pg_recvlogical: allow canceling initial password

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_receivewal, pg_recvlogical: allow canceling initial password
Date: 2021-11-21 19:14:00
Message-ID: E1mosHo-0000Wk-SM@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/33edf4a3ca4c1fdb7665ea3a4d01bb5fc7477117

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2021-11-22 00:29:46 pgsql: Remove lazy_scan_heap parallel VACUUM comment block.
Previous Message Tom Lane 2021-11-21 17:46:54 Re: pgsql: Require version 0.98 of Test::More for TAP tests