Lines Matching defs:tainted

79 #   The empty tainted value, for tainting strings
81 # A tainted zero, useful for tainting numbers
94 sub tainted ($) {
98 for (@_) { return 0 unless tainted $_ }
171 # tainted $TERM is unsafe only if it contains metachars
222 test 12, tainted $foo;
225 die "Taint checks don't seem to be enabled" unless tainted $foo;
228 test 13, not tainted $foo;
231 test 14, tainted $foo;
241 test 19, not tainted $foo;
244 test 20, not tainted $foo;
251 test 22, tainted $foo;
255 test 24, tainted $foo;
260 test 26, tainted $foo;
264 test 28, tainted $pi;
267 test 29, not tainted $pi;
288 # Reading from a file should be tainted
296 test 33, tainted $block;
297 test 34, tainted $line;
314 # Output of commands should be tainted
317 test 37, tainted $foo;
320 # Certain system variables should be tainted
328 test 39, tainted $foo;
339 test 43, tainted $foo; # $foo should still be tainted!
343 # Operations which affect files can't use tainted data.
387 # Operations which affect directories can't use tainted data.
407 # Some operations using files can't use tainted data.
413 my $filename = "./taintB$$"; # NB: $filename isn't tainted!
433 # Commands to the system can't use tainted data
469 # Operations which affect processes can't use tainted data.
491 # Some miscellaneous operations can't use tainted data.
528 test 101, not tainted $fooref;
529 test 102, tainted $$fooref;
530 test 103, tainted $foo;
538 test 105, tainted($foo = $bar);
539 test 106, tainted($bar = $bar);
540 test 107, tainted($bar += $bar);
541 test 108, tainted($bar -= $bar);
542 test 109, tainted($bar *= $bar);
543 test 110, tainted($bar++);
544 test 111, tainted($bar /= $bar);
545 test 112, tainted($bar += 0);
546 test 113, tainted($bar -= 2);
547 test 114, tainted($bar *= -1);
548 test 115, tainted($bar /= 1);
549 test 116, tainted($bar--);
555 my @foo = ("A", "tainted" . $TAINT, "B");
556 test 118, not tainted $foo[0];
557 test 119, tainted $foo[1];
558 test 120, not tainted $foo[2];
560 test 121, not tainted $bar[0];
561 test 122, tainted $bar[1];
562 test 123, not tainted $bar[2];
563 my @baz = eval { "A", "tainted" . $TAINT, "B" };
564 test 124, not tainted $baz[0];
565 test 125, tainted $baz[1];
566 test 126, not tainted $baz[2];
567 my @plugh = eval q[ "A", "tainted" . $TAINT, "B" ];
568 test 127, not tainted $plugh[0];
569 test 128, tainted $plugh[1];
570 test 129, not tainted $plugh[2];
571 my $nautilus = sub { "A", "tainted" . $TAINT, "B" };
572 test 130, not tainted ((&$nautilus)[0]);
573 test 131, tainted ((&$nautilus)[1]);
574 test 132, not tainted ((&$nautilus)[2]);
576 test 133, not tainted $xyzzy[0];
577 test 134, tainted $xyzzy[1];
578 test 135, not tainted $xyzzy[2];
579 my $red_october = sub { return "A", "tainted" . $TAINT, "B" };
580 test 136, not tainted ((&$red_october)[0]);
581 test 137, tainted ((&$red_october)[1]);
582 test 138, not tainted ((&$red_october)[2]);
584 test 139, not tainted $corge[0];
585 test 140, tainted $corge[1];
586 test 141, not tainted $corge[2];
596 test 142,( not tainted $getpwent[0]
597 and tainted $getpwent[1]
598 and not tainted $getpwent[2]
599 and not tainted $getpwent[3]
600 and not tainted $getpwent[4]
601 and not tainted $getpwent[5]
602 and tainted $getpwent[6] # ge?cos
603 and not tainted $getpwent[7]
604 and tainted $getpwent[8]); # shell
614 test 143, tainted $readdir;
628 test 144, tainted $readlink;
639 test 145, not tainted $j;
642 test 146, tainted $j;
649 test 147, tainted $why;
653 test 148, tainted $why;
656 test 149, tainted $why;
688 test 150, tainted $rcvd;
728 test 151, tainted $rcvd;
744 print "not " unless tainted($a) && tainted($b) && !defined($b);
757 print "not " unless !tainted($c->{a}) && tainted($c->{b});
762 print "not " unless tainted($d->{a}) && !tainted($d->{b});
767 print "not " unless !tainted($e->{a}) &&
768 !tainted($e->{b}) &&
769 tainted($e->{b}->{c}) &&
770 !tainted($e->{b}->{d});
903 # Check that all environment variables are tainted.
906 if (!tainted($v) &&
928 test 180, tainted $re1;
931 test 181, tainted $re2;
934 test 182, tainted $re3;
948 for (184..205) {print "not ok $_ # TODO tainted %ENV warning occludes tainted arguments warning\n";}
993 test 206, tainted(my $foo = $1);
1005 test 209, !tainted($1);
1007 test 210, !tainted($notaint);
1012 test 211, !tainted($1);
1013 test 212, !tainted($l);
1016 test 213, tainted($1);
1017 test 214, tainted($l);
1021 test 215, !tainted($1);
1022 test 216, !tainted($l);
1025 test 217, tainted($1);
1026 test 218, tainted($l);
1030 test 219, !tainted($1);
1032 test 220, tainted($1);
1036 # assigning tainted data to it is now an error
1038 test 221, !tainted($^O);
1040 test 222, !tainted($^O);