hotshot has asked for the wisdom of the Perl Monks concerning the following question:
It all started when I concatenated $path to $ENV{PATH} instead of replacing $ENV{PATH}, I did that because the command I'm running needs not only it's path in order to run, it needs also the original path, that's why I can't override it.{ $path = &launderFile($path); $ENV{PATH} .= ":$path"; # add the path we found to the environment + variable delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; # Make %ENV safer $command = &launderName($command); if (defined($output) && $output ne '') { if ($output eq $OUTHANDLER) { # output is directed to a filehand +ler and returned as an array if (! open(CMD, "$command 2>&1 |")) { warn "In performLocalCommand(): Can't open $command for readin +g: $!"; return; } &do_something(); } else { ... } } else { # ignores command output ... } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Insecure problem
by lestrrat (Deacon) on Oct 23, 2002 at 10:59 UTC |