Skip to content

Commit

Permalink
DBI_PASS may legally be set to ""
Browse files Browse the repository at this point in the history
  • Loading branch information
H.Merijn Brand - Tux committed Feb 7, 2014
1 parent fd802f1 commit ed3a0ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ WriteMakefile1(%MakeParams);
closing_msg()
if !$EMBEDDED
and !$interactive
and ( !$ENV{DBI_PASS} and !$ENV{ISC_PASSWORD} );
and ( !defined $ENV{DBI_PASS} and !defined $ENV{ISC_PASSWORD} );


exit 0;
Expand Down
14 changes: 8 additions & 6 deletions t/TestFirebird.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ sub new {
sub check_credentials {
my $self = shift;

unless ( $self->{pass}
or $ENV{DBI_PASS}
or $ENV{ISC_PASSWORD} )
unless ( defined $self->{pass}
or defined $ENV{DBI_PASS}
or defined $ENV{ISC_PASSWORD} )
{
plan skip_all =>
"Neither DBI_PASS nor ISC_PASSWORD present in the environment";
Expand Down Expand Up @@ -163,8 +163,8 @@ sub check_and_set_cached_configs {
my $error_str = q{};

# Check user and pass, try the get from ENV if missing
$self->{user} ||= $self->get_user;
$self->{pass} ||= $self->get_pass;
defined $self->{user} or $self->{user} = $self->get_user;
defined $self->{pass} or $self->{pass} = $self->get_pass;

# Check host
$self->{host} ||= $self->get_host;
Expand Down Expand Up @@ -206,7 +206,9 @@ sub get_user {
sub get_pass {
my $self = shift;

return $ENV{DBI_PASS} || $ENV{ISC_PASSWORD} || q{masterkey};
return defined $ENV{DBI_PASS} ? $ENV{DBI_PASS}
: defined $ENV{ISC_PASSWORD} ? $ENV{ICS_PASSWORD}
: "masterkey";
}

sub get_host {
Expand Down

0 comments on commit ed3a0ce

Please sign in to comment.