summaryrefslogtreecommitdiff
path: root/src/bin/psql/startup.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2016-08-08 10:07:46 -0400
committerNoah Misch <noah@leadboat.com>2016-08-08 10:07:51 -0400
commitafabfcc0eb16d64bedeaf8152ef748f99edba55d (patch)
treea673417f4aab6de8937b8a933c0ec8021eb95b2f /src/bin/psql/startup.c
parentfed83cdac44da06915f9cf5926a282848841f7c1 (diff)
Introduce a psql "\connect -reuse-previous=on|off" option.
The decision to reuse values of parameters from a previous connection has been based on whether the new target is a conninfo string. Add this means of overriding that default. This feature arose as one component of a fix for security vulnerabilities in pg_dump, pg_dumpall, and pg_upgrade, so back-patch to 9.1 (all supported versions). In 9.3 and later, comment paragraphs that required update had already-incorrect claims about behavior when no connection is open; fix those problems. Security: CVE-2016-5424
Diffstat (limited to 'src/bin/psql/startup.c')
-rw-r--r--src/bin/psql/startup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 2ab5690e547..210be63f67c 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -204,7 +204,7 @@ main(int argc, char *argv[])
values[2] = options.username;
keywords[3] = "password";
values[3] = password;
- keywords[4] = "dbname";
+ keywords[4] = "dbname"; /* see do_connect() */
values[4] = (options.action == ACT_LIST_DB &&
options.dbname == NULL) ?
"postgres" : options.dbname;