X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fextra%2Ftaint.t;fp=t%2F54taint.t;h=e8c6af19a5a150b2431b4cd6e86dfce85d67b014;hb=2ff029823;hp=fbf028666d208626c5248e07377eba6eea4eff8a;hpb=c9f4555e1f3716a055ecec41c39369a66f66b38b;p=dbsrgits%2FDBIx-Class.git diff --git a/t/54taint.t b/xt/extra/taint.t similarity index 96% rename from t/54taint.t rename to xt/extra/taint.t index fbf0286..e8c6af1 100644 --- a/t/54taint.t +++ b/xt/extra/taint.t @@ -1,8 +1,22 @@ BEGIN { $ENV{DBICTEST_ANFANG_DEFANG} = 1 } +# When in taint mode, PERL5LIB is ignored (but *not* unset) +# Put it back in INC so that local-lib users can actually +# run this test. Use lib.pm instead of an @INC unshift as +# it will correctly add any arch subdirs encountered +# +# Yes, this is a lazy solution: adding -I args in the exec below is the +# more sensible approach, but no time to properly do it at present +use Config; +use lib ( + grep { length } + map { split /\Q$Config{path_sep}\E/, (/^(.*)$/)[0] } # untainting regex + grep { defined } + @ENV{qw(PERL5LIB PERLLIB)} # precedence preserved by lib +); + use strict; use warnings; -use Config; # there is talk of possible perl compilations where -T is fatal or just # doesn't work. We don't want to have the user deal with that. @@ -45,18 +59,6 @@ BEGIN { unless ($INC{'t/lib/DBICTest/WithTaint.pm'}) { exec( $perl, qw( -I. -Mt::lib::DBICTest::WithTaint -T ), __FILE__ ); }} -# When in taint mode, PERL5LIB is ignored (but *not* unset) -# Put it back in INC so that local-lib users can actually -# run this test. Use lib.pm instead of an @INC unshift as -# it will correctly add any arch subdirs encountered - -use lib ( - grep { length } - map { split /\Q$Config{path_sep}\E/, (/^(.*)$/)[0] } # untainting regex - grep { defined } - @ENV{qw(PERL5LIB PERLLIB)} # precedence preserved by lib -); - # We need to specify 'lib' here as well because even if it was already in # @INC, the above will have put our local::lib in front of it, so now an # installed DBIx::Class will take precedence over the one we're trying to test.