From: Magnus Hagander Date: Sun, 15 Dec 2013 14:04:23 +0000 (+0100) Subject: Get username and password from separate variables for login X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=pgcommitfest.git Get username and password from separate variables for login This should hopefully keep them out of error messages, and thus not leak the login details if there is a network problem. --- diff --git a/perl-lib/PgCommitFest/Handler.pm b/perl-lib/PgCommitFest/Handler.pm index 097b7e7..77e7a62 100644 --- a/perl-lib/PgCommitFest/Handler.pm +++ b/perl-lib/PgCommitFest/Handler.pm @@ -99,7 +99,13 @@ sub login { my $pg_login_db = PgCommitFest::DB->connect(defined $ENV{'PGCOMMITFEST_LOGIN_DB'} ? $ENV{'PGCOMMITFEST_LOGIN_DB'} - : 'dbi:Pg:dbname=pgcommitfest user=pgcommitfest', '', ''); + : 'dbi:Pg:dbname=pgcommitfest user=pgcommitfest', + defined $ENV{'PGCOMMITFEST_LOGIN_DB_USERNAME'} ? + $ENV{'PGCOMMITFEST_LOGIN_DB_USERNAME'} : '', + + defined $ENV{'PGCOMMITFEST_LOGIN_DB_PASSWORD'} ? + $ENV{'PGCOMMITFEST_LOGIN_DB_PASSWORD'} : '' + ); my $u = $pg_login_db->select_one(<