postgresql/src/bin/pg_basebackup
Tom Lane c2242d3640 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
2021-11-21 14:13:35 -05:00
..
po Translation updates 2021-11-08 10:09:20 +01:00
t Add prefix checks in exclude lists for pg_rewind, pg_checksums and base backups 2020-02-24 18:14:22 +09:00
.gitignore Rename user-facing tools with "xlog" in the name to say "wal". 2017-02-09 16:23:46 -05:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls.mk Translation updates 2019-05-06 15:00:30 +02:00
pg_basebackup.c Replace use of sys_siglist[] with strsignal(). 2020-07-15 22:05:12 -04:00
pg_receivewal.c pg_receivewal, pg_recvlogical: allow canceling initial password prompt. 2021-11-21 14:13:35 -05:00
pg_recvlogical.c pg_receivewal, pg_recvlogical: allow canceling initial password prompt. 2021-11-21 14:13:35 -05:00
receivelog.c Fix a couple of memory leaks in src/bin/pg_basebackup/ 2021-07-26 11:14:17 +09:00
receivelog.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
streamutil.c Fix sscanf limits in pg_basebackup and pg_dump 2021-10-19 12:59:50 +02:00
streamutil.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
walmethods.c Clean up error handling in pg_basebackup's walmethods.c. 2021-11-17 14:16:34 -05:00
walmethods.h Fix a couple of memory leaks in src/bin/pg_basebackup/ 2021-07-26 11:14:17 +09:00