File: 0001-f_dir-should-exist.patch

package info (click to toggle)
libdbd-csv-perl 0.5300-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 320 kB
  • sloc: perl: 1,955; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 88c3ca044a3881eab62d6d2d38490351fd421386 Mon Sep 17 00:00:00 2001
From: "H.Merijn Brand - Tux" <linux@tux.freedom.nl>
Date: Wed, 28 Oct 2020 15:56:53 +0100
Subject: [PATCH] f_dir should exist

From a CVE fix in DBI-1.644 / DBD::File-0.45
---
 t/11_dsnlist.t | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/t/11_dsnlist.t b/t/11_dsnlist.t
index 8370976..3e97d45 100644
--- a/t/11_dsnlist.t
+++ b/t/11_dsnlist.t
@@ -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 ();
-- 
2.20.1