]> git.ipfire.org Git - thirdparty/postgresql.git/commit
In pg_dump, remember connection passwords no matter how we got them.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Dec 2015 19:25:31 +0000 (14:25 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Dec 2015 19:25:31 +0000 (14:25 -0500)
commit534a4159c290bd1d49bad702f7f600f92cfdcd67
tree442ac2f3d3ad48667a1abf1df90927750d2f99ef
parentbc72c3b3fa109760c66635450b386edd7a8c29c7
In pg_dump, remember connection passwords no matter how we got them.

When pg_dump prompts the user for a password, it remembers the password
for possible re-use by parallel worker processes.  However, libpq might
have extracted the password from a connection string originally passed
as "dbname".  Since we don't record the original form of dbname but
break it down to host/port/etc, the password gets lost.  Fix that by
retrieving the actual password from the PGconn.

(It strikes me that this whole approach is rather broken, as it will also
lose other information such as options that might have been present in
the connection string.  But we'll leave that problem for another day.)

In passing, get rid of rather silly use of malloc() for small fixed-size
arrays.

Back-patch to 9.3 where parallel pg_dump was introduced.

Report and fix by Zeus Kronion, adjusted a bit by Michael Paquier and me
src/bin/pg_dump/pg_backup_db.c