From ff402ae11b4d33e0e46c2730f63033d3631b8010 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 23 Dec 2015 15:45:43 -0500 Subject: Improve handling of password reuse in src/bin/scripts programs. This reverts most of commit 83dec5a71 in favor of having connectDatabase() store the possibly-reusable password in a static variable, similar to the coding we've had for a long time in pg_dump's version of that function. To avoid possible problems with unwanted password reuse, make callers specify whether it's reasonable to attempt to re-use the password. This is a wash for cases where re-use isn't needed, but it is far simpler for callers that do want that. Functionally there should be no difference. Even though we're past RC1, it seems like a good idea to back-patch this into 9.5, like the prior commit. Otherwise, if there are any third-party users of connectDatabase(), they'll have to deal with an API change in 9.5 and then another one in 9.6. Michael Paquier --- src/bin/scripts/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bin/scripts/common.h') diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h index dafd58f4225..90382959184 100644 --- a/src/bin/scripts/common.h +++ b/src/bin/scripts/common.h @@ -31,8 +31,8 @@ extern void handle_help_version_opts(int argc, char *argv[], extern PGconn *connectDatabase(const char *dbname, const char *pghost, const char *pgport, const char *pguser, - const char *pgpassword, enum trivalue prompt_password, - const char *progname, bool fail_ok); + enum trivalue prompt_password, const char *progname, + bool fail_ok, bool allow_password_reuse); extern PGconn *connectMaintenanceDatabase(const char *maintenance_db, const char *pghost, const char *pgport, const char *pguser, -- cgit v1.2.3