Thread Fragen zum Taintmodus (13 answers)
Opened by rosti at 2020-01-21 10:20

Linuxer
 2020-01-21 11:35
#191169 #191169
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
Prüfe doch mit Perldoc:Scalar::Util ob $class tainted ist.

Der Tainted-Status hängt nicht am Inhalt. Auch wenn $class leer sein sollte, ist es sehr wohl "tainted". Damit ist auch $classfile tainted und damit auch "$classfile.pm".

Beispiel:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
#! /usr/bin/perl -T
use strict;
use warnings;
use 5.010;

use Scalar::Util qw( tainted );

my $string = shift @ARGV // 'default';

say "'$string' is tainted: ", tainted($string);


Code: (dl )
1
2
3
4
5
6
7
8
$ perl -T t3.pl
'default' is tainted: 0

$ perl -T t3.pl "foo"
'foo' is tainted: 1

$ perl -T t3.pl ""
'' is tainted: 1
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread Fragen zum Taintmodus