[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make 4.2.1 test suite will break on Perl 5.26 ( Can't locate test_driver

From: Kent Fredric
Subject: make 4.2.1 test suite will break on Perl 5.26 ( Can't locate test_driver.pl in @INC )
Date: Sun, 26 Mar 2017 00:52:36 +1300

Perl 5.26 is removing the implicit CWD in @INC for security reasons, and this
affects loading of perl code from files in both "require" and "do".

Subsequently, both these lines in run_make_tests.pl no longer do as intended:

require "test_driver.pl";
require "config-flags.pm"

Affected end users can apply a temporary workaround of PERL_USE_UNSAFE_INC=1
which should return makes tests to passing.

But a long term strategy of forcing an explicit path loading should be applied.

For instance:

1. Put required libraries in a specific directory
2. `use lib "directory'` 

Alternatively, specifying a clearly relative/absolute path to the file
can side-step the @INC traversal mechanic.

  require "./test_driver.pl";
  require "./config-flags.pm"

Some constructions with FindBin.pm can also be useful, as can forcing an
absolute path with File::Spec->rel2abs(), for instance:

   my $file = File::Spec->rel2abs("test_driver.pl");
   require "$file";

And at a pinch, simply injecting an explict:

   use lib '.'

Will work, ( but it will be subject to security risks/breakage if
any part of your process changes cwd )

This failure was exposed testing Make against Perl 5.25.11 pre-release,
at Gentoo bug: https://bugs.gentoo.org/613772

Attachment: pgpJqsYro3qIB.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]