summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/ext/File-Glob/t/taint.t
blob: 4751303fe0ec63b2347ba519cb78d1ef2ce893b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!./perl -T

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib';
    require Config; import Config;
    if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
        print "1..0\n";
        exit 0;
    }
}

use Test::More;
BEGIN {
    plan(
        ${^TAINT}
        ? (tests => 2)
        : (skip_all => "Appear to running a perl without taint support")
    );
}

BEGIN {
    use_ok('File::Glob');
}

@a = File::Glob::bsd_glob("*");
eval { $a = join("",@a), kill 0; 1 };
like($@, qr/Insecure dependency/, 'all filenames should be tainted');