Hi, I've been working on a CGI script which is essentially a web interface for a perl script on the machine that does all of the heavy lifting. After getting things working on my own machine, I moved it over to a shared machine so that other people could use it. However, it isn't executing on this new machine. At first, I was getting errors about insecure dependencies and tainting issues, but even after seemingly dealing with those issues the perl script fails to execute after being called. For reference, here's the code on the old machine:
my $detail = ""; $detail = join("", $detail, "perl LGE.pl " ); $detail = join("", $detail, "--target $target ") if defined $targe +t; $detail = join("", $detail, "--port $portnum ") if defined $portnu +m; $detail = join("", $detail, "--interval $interval ") if defined $i +nterval; $detail = join("", $detail, "--protocol $protocol ") if defined $p +rotocol; $detail = join("", $detail, "--source $prmlist ") if defined $prml +ist; $detail = join("", $detail, "--start"); my $command = qx($detail);
And after dealing with the insecure dependency/ tainting issues:
my $detail = ""; $detail = join("", $detail, "/usr/bin/perl LGE.pl " ); $detail = join("", $detail, "--target $target ") if defined $targe +t; $detail = join("", $detail, "--port $portnum ") if defined $portnu +m; $detail = join("", $detail, "--interval $interval ") if defined $i +nterval; $detail = join("", $detail, "--protocol $protocol ") if defined $p +rotocol; $detail = join("", $detail, "--source $prmlist ") if defined $prml +ist; $detail = join("", $detail, "--start"); $ENV{'PATH'} = '/bin:/usr/bin'; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; untaint($detail); my $command = qx($detail);
It seems like the only real difference is the machine that the code is running on. I went back and ran the new CGI on the old machine and it works. Is it possible that something is preventing my CGI from properly interacting with my script, and if so, any guesses to what it might be?
Thanks,
Trenin
In reply to System Configuration Blocking CGI System Calls? by Trenin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |