postgresql/src/bin/scripts
Noah Misch 05abd3bcfe Field conninfo strings throughout src/bin/scripts.
These programs nominally accepted conninfo strings, but they would
proceed to use the original dbname parameter as though it were an
unadorned database name.  This caused "reindexdb dbname=foo" to issue an
SQL command that always failed, and other programs printed a conninfo
string in error messages that purported to print a database name.  Fix
both problems by using PQdb() to retrieve actual database names.
Continue to print the full conninfo string when reporting a connection
failure.  It is informative there, and if the database name is the sole
problem, the server-side error message will include the name.  Beyond
those user-visible fixes, this allows a subsequent commit to synthesize
and use conninfo strings without that implementation detail leaking into
messages.  As a side effect, the "vacuuming database" message now
appears after, not before, the connection attempt.  Back-patch to 9.1
(all supported versions).

Reviewed by Michael Paquier and Peter Eisentraut.

Security: CVE-2016-5424
2016-08-08 10:07:52 -04:00
..
po Translation updates 2016-05-09 10:08:57 -04:00
.gitignore pg_isready 2013-01-23 11:01:20 -05:00
clusterdb.c Field conninfo strings throughout src/bin/scripts. 2016-08-08 10:07:52 -04:00
common.c Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
common.h Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
createdb.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
createlang.c Field conninfo strings throughout src/bin/scripts. 2016-08-08 10:07:52 -04:00
createuser.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
dropdb.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
droplang.c Field conninfo strings throughout src/bin/scripts. 2016-08-08 10:07:52 -04:00
dropuser.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Makefile scripts: Add build prerequisite on libpgport 2013-02-08 06:43:54 -05:00
nls.mk Translation updates 2013-09-02 02:28:21 -04:00
pg_isready.c Mark response messages for translation in pg_isready. 2014-11-28 02:14:16 +09:00
reindexdb.c Field conninfo strings throughout src/bin/scripts. 2016-08-08 10:07:52 -04:00
vacuumdb.c Field conninfo strings throughout src/bin/scripts. 2016-08-08 10:07:52 -04:00