}
#endif
- if (PL_taint_warn && !(PL_dowarn & (G_WARN_ALL_OFF | G_WARN_ALL_ON | G_WARN_ON))) {
- PL_compiling.cop_warnings
- = Perl_new_warnings_bitfield(aTHX_ NULL, WARN_TAINTstring, WARNsize);
- }
-
if (!scriptname)
scriptname = argv[0];
if (PL_e_script) {
case 'w':
if (! (PL_dowarn & G_WARN_ALL_MASK)) {
PL_dowarn |= G_WARN_ON;
- if (PL_taint_warn) {
- if (!specialWARN(PL_compiling.cop_warnings))
- PerlMemShared_free(PL_compiling.cop_warnings);
- PL_compiling.cop_warnings = pWARN_STD;
- }
}
s++;
return s;
PL_compiling.cop_warnings = pWARN_ALL ;
else if (PL_dowarn & G_WARN_ALL_OFF)
PL_compiling.cop_warnings = pWARN_NONE ;
- else if (PL_taint_warn && !(PL_dowarn & G_WARN_ON)) {
- PL_compiling.cop_warnings
- = Perl_new_warnings_bitfield(aTHX_ NULL, WARN_TAINTstring, WARNsize);
- }
else
PL_compiling.cop_warnings = pWARN_STD ;
open(FH, "<abc") ;
$a = <FH> ;
close FH ;
+chdir $a;
+no warnings 'taint' ;
chdir $a ;
print "xxx\n" ;
+use warnings 'taint' ;
+chdir $a ;
+print "yyy\n" ;
EXPECT
+Insecure dependency in chdir while running with -T switch at - line 5.
+Insecure dependency in chdir while running with -T switch at - line 10.
xxx
+yyy
########
--TU
+-t
--FILE-- abc
def
--FILE--
open(FH, "<abc") ;
$a = <FH> ;
close FH ;
-use warnings 'taint' ;
+chdir $a;
+no warnings 'taint' ;
chdir $a ;
print "xxx\n" ;
-no warnings 'taint' ;
+use warnings 'taint' ;
chdir $a ;
print "yyy\n" ;
EXPECT
-Insecure dependency in chdir while running with -T switch at - line 6.
+Insecure dependency in chdir while running with -t switch at - line 5.
+Insecure dependency in chdir while running with -t switch at - line 10.
xxx
yyy
else
ug = " while running with -T switch";
if (PL_unsafe || PL_taint_warn) {
- if(ckWARN(WARN_TAINT))
+ if(ckWARN_d(WARN_TAINT))
Perl_warner(aTHX_ packWARN(WARN_TAINT), f, s, ug);
}
else {
#define WARNsize 12
#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125"
#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0"
-#define WARN_TAINTstring "\0\0\0\0\0\0\0\0\0\100\0\0"
#define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD)
#define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD)
#print WARN tab(5, '#define WARN_ALLstring'), '"', ('\377' x $warn_size) , "\"\n" ;
print WARN tab(5, '#define WARN_ALLstring'), '"', ('\125' x $warn_size) , "\"\n" ;
print WARN tab(5, '#define WARN_NONEstring'), '"', ('\0' x $warn_size) , "\"\n" ;
-my $WARN_TAINTstring = mkOct($warn_size, map $_ * 2, @{ $list{'taint'} });
-
-print WARN tab(5, '#define WARN_TAINTstring'), qq["$WARN_TAINTstring"\n] ;
print WARN <<'EOM';