in reply to Parallel processing, sort of
Saftey warning: You're passing $fullfile through the shell, potentialy doing all sorts of bad things.
eval 'my ($pid) = fork; if ($pid == 0) { exec "display -title %d/%f $fullfile" }';Consider $fullfile='; rm -rf /', or 'realfilename > ~/irreplacable.file', or even '</dev/urandom'.
Unless your input data file is implicitly trusted, you should be carefuly filtering it. Even if it is, you should be using the array form of exec -- exec(qw(display -title %d/%f), $fullfile).
Even then, consider what arguments display takes -- you should probably filter for filenames starting with a dash, or use a -- end-of-arguments marker, if display supports it.
Oh, and there's no reason to use stringy eval here; BLOCK eval will work just as well, and is much more efficent. (Stringy eval will recompile the argument every time.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parallel processing, sort of
by Preceptor (Deacon) on Sep 13, 2002 at 07:48 UTC |