From: Nicholas Clark Date: Sat, 13 May 2006 10:36:18 +0000 (+0000) Subject: Can't do require Foo if $tainted; because taint tunnels. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a327f6f76d778aa12eddd09664ddf61c15a188e0;p=p5sagit%2Fp5-mst-13.2.git Can't do require Foo if $tainted; because taint tunnels. (Documented, but I regard this as a serious practical deficiency in tainting) p4raw-id: //depot/perl@28185 --- diff --git a/lib/Tie/RefHash.pm b/lib/Tie/RefHash.pm index 30a90d9..2f09628 100644 --- a/lib/Tie/RefHash.pm +++ b/lib/Tie/RefHash.pm @@ -2,7 +2,7 @@ package Tie::RefHash; use vars qw/$VERSION/; -$VERSION = "1.34"; +$VERSION = "1.34_01"; =head1 NAME @@ -96,7 +96,12 @@ BEGIN { use Config (); my $usethreads = $Config::Config{usethreads}; # && exists $INC{"threads.pm"} *_HAS_THREADS = $usethreads ? sub () { 1 } : sub () { 0 }; - require Scalar::Util if $usethreads; # we need weaken() + if ($usethreads) { + # The magic of taint tunneling means that we can't do this require in the + # same statement as the boolean check on $usethreads, as $usethreads is + # tainted. + require Scalar::Util; + } } BEGIN {