| 1 | #!./perl -T |
| 2 | |
| 3 | BEGIN { |
| 4 | chdir 't' if -d 't'; |
| 5 | if ($^O eq 'MacOS') { |
| 6 | @INC = qw(: ::lib ::macos:lib); |
| 7 | } else { |
| 8 | @INC = '.'; |
| 9 | push @INC, '../lib'; |
| 10 | } |
| 11 | require Config; import Config; |
| 12 | if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) { |
| 13 | print "1..0\n"; |
| 14 | exit 0; |
| 15 | } |
| 16 | print "1..2\n"; |
| 17 | } |
| 18 | END { |
| 19 | print "not ok 1\n" unless $loaded; |
| 20 | } |
| 21 | use File::Glob; |
| 22 | $loaded = 1; |
| 23 | print "ok 1\n"; |
| 24 | |
| 25 | # all filenames should be tainted |
| 26 | @a = File::Glob::bsd_glob("*"); |
| 27 | eval { $a = join("",@a), kill 0; 1 }; |
| 28 | unless ($@ =~ /Insecure dependency/) { |
| 29 | print "not "; |
| 30 | } |
| 31 | print "ok 2\n"; |