diff --git a/Test-Taint-1.06-Test-taintedness-on-X-instead-of-environment-variabl.patch b/Test-Taint-1.06-Test-taintedness-on-X-instead-of-environment-variabl.patch new file mode 100644 index 0000000..888ca5b --- /dev/null +++ b/Test-Taint-1.06-Test-taintedness-on-X-instead-of-environment-variabl.patch @@ -0,0 +1,68 @@ +From cab25a93c2e8383cff35f55271a60f51645c98ff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 18 Jan 2017 11:02:39 +0100 +Subject: [PATCH] Test taintedness on $^X instead of environment variables +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Test::Simple adds TEST_ACTIVE and TEST2_ACTIVE members into %Env. +These are not tainted. t/tainted_ok.t and t/tainted.t tests can fail +if they pick up one of them. + +This patch changes the tests to use $^X, interpreter path, instead as +discussed and implemented in simalar Scalar-List-Utils' bug +. + +Signed-off-by: Petr Písař +--- + t/tainted.t | 7 ++----- + t/tainted_ok.t | 5 +---- + 2 files changed, 3 insertions(+), 9 deletions(-) + +diff --git a/t/tainted.t b/t/tainted.t +index bf1e629..f5fb6d1 100644 +--- a/t/tainted.t ++++ b/t/tainted.t +@@ -7,11 +7,8 @@ use Test::More tests => 6; + + use Test::Taint; + +-my @keys = keys %ENV; +-my $key = shift @keys; +- + taint_checking_ok(); +-ok( tainted($ENV{$key}), "\$ENV{$key} is tainted" ); ++ok( tainted($^X), "\$^X is tainted" ); + + my $foo = 43; + ok( !tainted($foo), '43 is not tainted' ); +@@ -21,7 +18,7 @@ RESET_SIG_DIE: { + + local $SIG{__DIE__} = sub { $counter++ }; + +- ok( tainted($ENV{$key}), "\$ENV{$key} is tainted" ); ++ ok( tainted($^X), "\$^X is tainted" ); + is($counter, 0, 'counter was not incremented (our die did not fire)'); + + eval { die 'validly' }; +diff --git a/t/tainted_ok.t b/t/tainted_ok.t +index 2dcc9db..ce87343 100644 +--- a/t/tainted_ok.t ++++ b/t/tainted_ok.t +@@ -5,11 +5,8 @@ use strict; + + use Test::Taint tests=>3; + +-my @keys = keys %ENV; +-my $key = shift @keys; +- + taint_checking_ok(); +-tainted_ok( $ENV{$key}, "\$ENV{$key} is tainted" ); ++tainted_ok( $^X, "\$^X is tainted" ); + + my $foo = 43; + untainted_ok( $foo ); +-- +2.7.4 + diff --git a/perl-Test-Taint.spec b/perl-Test-Taint.spec index 20656ab..1eb02d7 100644 --- a/perl-Test-Taint.spec +++ b/perl-Test-Taint.spec @@ -1,12 +1,17 @@ Summary: Tools to test taintedness Name: perl-Test-Taint Version: 1.06 -Release: 14%{?dist} +Release: 15%{?dist} License: GPL+ or Artistic -Group: Development/Libraries URL: http://search.cpan.org/dist/Test-Taint/ Source0: http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/Test-Taint-%{version}.tar.gz +# RHBZ#1413022, CPAN#119897 +Patch0: Test-Taint-1.06-Test-taintedness-on-X-instead-of-environment-variabl.patch + +BuildRequires: %{__perl} +BuildRequires: %{__make} + BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(base) @@ -42,14 +47,14 @@ Test::More style. %build %{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="${RPM_OPT_FLAGS}" NO_PACKLIST=1 -make %{?_smp_mflags} +%{__make} %{?_smp_mflags} %install -make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT +%{__make} pure_install DESTDIR=$RPM_BUILD_ROOT chmod -R u+w $RPM_BUILD_ROOT/* %check -make test +%{__make} test %files %doc Changes @@ -58,6 +63,10 @@ make test %{_mandir}/man3/* %changelog +* Wed Feb 15 2017 Ralf Corsépius - 1.06-15 +- Add Test-Taint-1.06-Test-taintedness-on-X-instead-of-environment-variabl.patch. + (Address RHBZ#1413022, F26FTBFS) + * Sat Feb 11 2017 Fedora Release Engineering - 1.06-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild