This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Turn taint warnings (-t) into severe warnings, so they're
[perl5.git] / t / lib / warnings / taint
CommitLineData
0453d815 1 taint.c AOK
599cee73 2
599cee73
PM
3 Insecure %s%s while running with -T switch
4
599cee73 5__END__
0453d815
PM
6-T
7--FILE-- abc
8def
9--FILE--
599cee73 10# taint.c
0453d815
PM
11open(FH, "<abc") ;
12$a = <FH> ;
13close FH ;
14chdir $a ;
15print "xxx\n" ;
599cee73 16EXPECT
0453d815 17Insecure dependency in chdir while running with -T switch at - line 5.
599cee73 18########
0453d815
PM
19-TU
20--FILE-- abc
21def
22--FILE--
599cee73 23# taint.c
0453d815
PM
24open(FH, "<abc") ;
25$a = <FH> ;
26close FH ;
b7bf404b
RGS
27chdir $a;
28no warnings 'taint' ;
0453d815
PM
29chdir $a ;
30print "xxx\n" ;
b7bf404b
RGS
31use warnings 'taint' ;
32chdir $a ;
33print "yyy\n" ;
599cee73 34EXPECT
b7bf404b
RGS
35Insecure dependency in chdir while running with -T switch at - line 5.
36Insecure dependency in chdir while running with -T switch at - line 10.
0453d815 37xxx
b7bf404b 38yyy
0453d815 39########
b7bf404b 40-t
0453d815
PM
41--FILE-- abc
42def
43--FILE--
44# taint.c
45open(FH, "<abc") ;
46$a = <FH> ;
47close FH ;
b7bf404b
RGS
48chdir $a;
49no warnings 'taint' ;
0453d815
PM
50chdir $a ;
51print "xxx\n" ;
b7bf404b 52use warnings 'taint' ;
0453d815
PM
53chdir $a ;
54print "yyy\n" ;
55EXPECT
b7bf404b
RGS
56Insecure dependency in chdir while running with -t switch at - line 5.
57Insecure dependency in chdir while running with -t switch at - line 10.
0453d815
PM
58xxx
59yyy