Skip to content

Commit

Permalink
f_dir should exist
Browse files Browse the repository at this point in the history
From a CVE fix in DBI-1.644 / DBD::File-0.45
  • Loading branch information
Tux committed Oct 28, 2020
1 parent 69f1650 commit 88c3ca0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion t/11_dsnlist.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ ok (@dsn >= 2, "more than one");
ok ($dbh->disconnect, "disconnect");

# Try different DSN's
foreach my $d (qw( . example lib t )) {
foreach my $d (qw( . examples lib t )) {
ok (my $dns = Connect ("dbi:CSV:f_dir=$d"), "use $d as f_dir");
ok ($dbh->disconnect, "disconnect");
}

if ($DBD::File::VERSION ge "0.45") {
my @err;
is (eval {
local $SIG{__WARN__} = sub { push @err => @_ };
local $SIG{__DIE__} = sub { push @err => @_ };
Connect ("dbi:CSV:f_dir=d/non/exist/here");
}, undef, "f_dir = nonexting dir");
like ("@err", qr{d/non/exist/here}, "Error caught");
}

done_testing ();

0 comments on commit 88c3ca0

Please sign in to comment.