Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -wT use strict; use warnings; use XML::Simple; # used to read the xml config file my $parser = new XML::Simple(keeproot => 0); my $_config_file = "blah.xml"; my $_config_path = "/some/path"; unless ($_config_path =~ m#^(/some/path)$#){ #some regex I suspect wi +ll untaint the data, but i wonder is this is needed because I set the + vars from within my program # and from what I is that taint only check data from other processes die("FATAL Error, the path you provide doens't seem to be a valid + path at all"); } print "match $1 \n"; my $config_path=$1; my $file= "${config_path}/${_config_file}"; print "complete path to file: $file \n"; my $_Config = $parser->XMLin($file); print "\$_config = $_Config \n";
20051019 Janitored by Corion: Removed BR tags from code
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: run script in taint mode
by mulander (Monk) on Oct 19, 2005 at 11:51 UTC | |
Re: run script in taint mode
by snowhare (Friar) on Oct 19, 2005 at 14:39 UTC | |
by Anonymous Monk on Oct 20, 2005 at 06:45 UTC | |
by snowhare (Friar) on Oct 23, 2005 at 15:59 UTC |