cdea73
From ff8028c4d95425faa5b0705b8ed8c84b1112c7e4 Mon Sep 17 00:00:00 2001
cdea73
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
cdea73
Date: Wed, 2 Aug 2017 17:29:13 +0200
cdea73
Subject: [PATCH] Use exucatable name as a source of taintedness
cdea73
MIME-Version: 1.0
cdea73
Content-Type: text/plain; charset=UTF-8
cdea73
Content-Transfer-Encoding: 8bit
cdea73
cdea73
Test::Simple >= 1.302065 injects variables into the environment. These
cdea73
are not tainted and caused a random t/07_taint.t test failures.
cdea73
cdea73
This patch fixes it by using executable name $0 instead.
cdea73
cdea73
https://github.com/pjf/ipc-system-simple/issues/21
cdea73
Signed-off-by: Petr Písař <ppisar@redhat.com>
cdea73
---
cdea73
 t/07_taint.t | 4 ++--
cdea73
 1 file changed, 2 insertions(+), 2 deletions(-)
cdea73
cdea73
diff --git a/t/07_taint.t b/t/07_taint.t
cdea73
index 49cee12..be449cd 100644
cdea73
--- a/t/07_taint.t
cdea73
+++ b/t/07_taint.t
cdea73
@@ -17,8 +17,8 @@ use_ok("IPC::System::Simple","run","capture");
cdea73
 
cdea73
 chdir("t");     # Ignore return, since we may already be in t/
cdea73
 
cdea73
-my $taint = $ENV{(keys(%ENV))[0]} . "foo";	# ."foo" to avoid zero length
cdea73
-ok(tainted($taint),"Sanity - ENV vars are tainted");
cdea73
+my $taint = $0 . "foo";	# ."foo" to avoid zero length
cdea73
+ok(tainted($taint),"Sanity - executable name is tainted");
cdea73
 
cdea73
 my $evil_zero = 1 - (length($taint) / length($taint));
cdea73
 
cdea73
-- 
cdea73
2.9.4
cdea73