in reply to Taint problem opening file to write
from perlsec, The only way to bypass the tainting mechanism is by referencing subpatterns from a regular expression match. Perl presumes that if you reference a substring using $1, $2, etc., that you knew what you were doing when you wrote the pattern.
so you need to do something like this (modified from perlsec)
if ($file_out =~ /^([-\@\w.]+)$/) { $file_out = $1; # $data now untainted } else { die "Bad data in $file_out"; # log this somewhere }
-derby
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Taint problem opening file to write
by fireartist (Chaplain) on Apr 30, 2002 at 12:54 UTC |