in reply to Re^2: -T switch & untaint - how to resolve errors?
in thread -T switch & untaint - how to resolve errors?
I've asked a question about another topic here, but I think you can find the answers quite useful for your tainting doubts.$name = untaint($name); $siteName = untaint($siteName); open (FILE,">/$directory/tmpl/$name.tmpl"); print FILE $content; close(FILE); sub untaint { my $var = $_[0]; unless ($var =~ m/^(\w+)$/) { #allow filename to be [a-zA-Z0-9_] die("Tainted"); } return $var; }
Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")
Don't fool yourself.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: -T switch & untaint - how to resolve errors?
by Stenyj (Beadle) on Apr 10, 2005 at 21:11 UTC | |
by Joost (Canon) on Apr 10, 2005 at 21:46 UTC | |
by Stenyj (Beadle) on Apr 10, 2005 at 22:00 UTC | |
by doom (Deacon) on Apr 11, 2005 at 03:30 UTC |