From 2f87c62b5e185122a74e98218c348b1da42db736 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 15 Dec 2013 15:04:23 +0100 Subject: [PATCH] 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. --- perl-lib/PgCommitFest/Handler.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(<