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