X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F54taint.t;fp=t%2F54taint.t;h=7f0db9aa75186d7d182902356600e5860b31d6e4;hb=66a65d81075460c8508f300b26209bc77cbed6d6;hp=cfcde4344fceda13481311c874e83f937ce1e03e;hpb=777447e927d828478debc4e011aa2f28707bc008;p=dbsrgits%2FDBIx-Class.git diff --git a/t/54taint.t b/t/54taint.t index cfcde43..7f0db9a 100644 --- a/t/54taint.t +++ b/t/54taint.t @@ -10,12 +10,15 @@ BEGIN { unless ($INC{'t/lib/DBICTest/WithTaint.pm'}) { # and with relative paths *and* with a relative $^X and some other # craziness... in short: just be proactive require File::Spec; - $ENV{PATH} = join $Config{path_sep}, - map { length($_) ? File::Spec->rel2abs($_) : () } - split /\Q$Config{path_sep}/, $ENV{PATH} - ; - my $perl = $^X; - ($_) = $_ =~ /\A(.+)\z/ for ( $ENV{PATH}, $perl ); + + if (length $ENV{PATH}) { + ( $ENV{PATH} ) = join ( $Config{path_sep}, + map { length($_) ? File::Spec->rel2abs($_) : () } + split /\Q$Config{path_sep}/, $ENV{PATH} + ) =~ /\A(.+)\z/; + } + + my ($perl) = $^X =~ /\A(.+)\z/; { local $ENV{PATH} = "/nosuchrootbindir"; @@ -63,7 +66,7 @@ throws_ok ( sub { $ENV{PATH} . (kill (0)) }, qr/Insecure dependency in kill/, 'taint mode active' -); +) if length $ENV{PATH}; { package DBICTest::Taint::Classes;