[Libguestfs] [PATCH] tests: do not assume '.' is in Perl's @INC

Pino Toscano ptoscano at redhat.com
Fri Sep 9 12:59:22 UTC 2016


Upstream Perl is going to remove '.' from @INC (the include path for
modules) by default for the next major release (= 5.26) [1], as measure
to fix security issues.  Debian already started backporting the fixes
for this [2], thus behaving this way in current Sid installations.

Since the affected Perl sources are only the local daemon testing
scripts, a simple fix is to force the 'requires' for the local
captive-daemon.pm module to start from the current directory: this way
there is no need to manually augment @INC, and only our local module is
loaded automatically.

[1] https://rt.perl.org/Public/Bug/Display.html?id=127810
[2] https://lists.debian.org/debian-devel-announce/2016/08/msg00013.html
---
 tests/daemon/test-btrfs.pl        | 2 +-
 tests/daemon/test-daemon-start.pl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/daemon/test-btrfs.pl b/tests/daemon/test-btrfs.pl
index 302ecb9..7b306b7 100755
--- a/tests/daemon/test-btrfs.pl
+++ b/tests/daemon/test-btrfs.pl
@@ -23,7 +23,7 @@ use warnings;
 
 use File::Temp qw/tempdir/;
 
-require 'captive-daemon.pm';
+require './captive-daemon.pm';
 
 # Set $PATH to include directory that will have phony 'btrfs' binary.
 my $bindir = tempdir (CLEANUP => 1);
diff --git a/tests/daemon/test-daemon-start.pl b/tests/daemon/test-daemon-start.pl
index 8cc59d9..93e0b24 100755
--- a/tests/daemon/test-daemon-start.pl
+++ b/tests/daemon/test-daemon-start.pl
@@ -21,7 +21,7 @@
 use strict;
 use warnings;
 
-require 'captive-daemon.pm';
+require './captive-daemon.pm';
 
 sub tests {
     my $g = shift;
-- 
2.7.4




More information about the Libguestfs mailing list