Here is the php script code:
if($action == "manualbackup")
{
echo "<pre>\n";
if(system(EscapeShellCmd("/wwwi/app/mitelbkp/perform_backup_suid $id")))
{
}
else
{
echo "\nSystem command failed";
}
echo "</pre>\n";
exit;
}
The source for perform_backup_suid looks like:
#define REAL_PATH "/wwwi/app/mitelbkp/perform_backup"
main(ac, av)
char **av;
{
execv(REAL_PATH, av);
}
perform_backup is a Perl script. Ther Perl script fails here:
$kcount = 10000;
while($kcount > $kermit_limit)
{
#system("ls");
print("checking number of backups already in progress...");
# count the number of running kermits
$kcount = `(/bin/ps auxw | /bin/grep ermit | /bin/grep mitelbkp | /bin/gre
p -v grep | /usr/bin/wc --lines) 2>&1`;
if($? == 0)
{
print("done\n");
}
else
{
print("error\n");
}
chop $kcount;
$kcount =~ /([0-9]+)/;
$kcount = $1;
print "too many running kermits ($kcount already running)\n";
sleep 3;
}
If you uncomment the system("ls") line then the perl script will die at that line. There is no error message in the error_log apache log file.
Erik