in reply to cgi taint trouble
This prevents potentially bad metacharacters from being interpreted by the shell (which system would use otherwise). In addition, to help out with taint checking, the following sub is suggested to test for tainted variables:@args = qw/-p $project->name/; push @args, '-f' if $force; system "inc_seqs", @args;
Good luck!sub is_tainted { my $arg = shift; my $nada = substr( $arg, 0, 0 ); # zero-length local $@; # preserve caller's version eval { eval "# $nada" }; return length($@) != 0; }
|
|---|