pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@postgresql.org
Subject: pgsql: Field conninfo strings throughout src/bin/scripts.
Date: Mon, 08 Aug 2016 14:10:48 +0000
Message-ID: <E1bWlGS-0006oy-KL@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

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

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/a466ea33c0acbf9938144ffd9eecdabbb69e8f46

Modified Files
--------------
src/bin/scripts/clusterdb.c  |  4 ++--
src/bin/scripts/createlang.c |  4 ++--
src/bin/scripts/droplang.c   |  4 ++--
src/bin/scripts/reindexdb.c  | 24 ++++++++++++------------
src/bin/scripts/vacuumdb.c   |  4 ++--
5 files changed, 20 insertions(+), 20 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1bWlGS-0006oy-KL@gemulon.postgresql.org>
Permalink:  ../E1bWlGS-0006oy-KL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bWlGS-0006oy-KL@gemulon.postgresql.org

 · 

reply

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: noah@leadboat.com
  Subject: Re: pgsql: Field conninfo strings throughout src/bin/scripts.
  In-Reply-To: <E1bWlGS-0006oy-KL@gemulon.postgresql.org>
  References: <E1bWlGS-0006oy-KL@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