From 0d3df6e1fe1fe0f2a6ba0dbfa726c860badc8bbd Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 12 Apr 2010 05:49:16 +0000 Subject: [PATCH] - fixed some left-overs when using safe_exec which have not been escaped correctly, fixes #136 --- lib/cron_init.php | 2 +- scripts/jobs/cron_tasks.inc.dns.10.bind.php | 2 +- scripts/jobs/cron_tasks.inc.http.10.apache.php | 2 +- scripts/jobs/cron_tasks.inc.http.20.lighttpd.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cron_init.php b/lib/cron_init.php index e62f2fc0..fc4908d6 100644 --- a/lib/cron_init.php +++ b/lib/cron_init.php @@ -75,7 +75,7 @@ while($fName = readdir($lockDirHandle)) // Check if cron is running or has died. $check_pid = substr(strstr($fName, "-"), 1); - system("kill -CHLD " . $check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return); + system("kill -CHLD " . (int)$check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return); if($check_pid_return == 1) { diff --git a/scripts/jobs/cron_tasks.inc.dns.10.bind.php b/scripts/jobs/cron_tasks.inc.dns.10.bind.php index 0579afb1..d8c686e4 100644 --- a/scripts/jobs/cron_tasks.inc.dns.10.bind.php +++ b/scripts/jobs/cron_tasks.inc.dns.10.bind.php @@ -137,7 +137,7 @@ class bind fclose($bindconf_file_handler); fwrite($this->debugHandler, ' cron_tasks: Task4 - froxlor_bind.conf written' . "\n"); $this->logger->logAction(CRON_ACTION, LOG_INFO, 'froxlor_bind.conf written'); - safe_exec($this->settings['system']['bindreload_command']); + safe_exec(escapeshellcmd($this->settings['system']['bindreload_command'])); fwrite($this->debugHandler, ' cron_tasks: Task4 - Bind9 reloaded' . "\n"); $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Bind9 reloaded'); $domains_dir = makeCorrectDir($this->settings['system']['bindconf_directory'] . '/domains/'); diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index ac1beaf3..8fa4470e 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -59,7 +59,7 @@ class apache { fwrite($this->debugHandler, ' apache::reload: reloading apache' . "\n"); $this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading apache'); - safe_exec($this->settings['system']['apachereload_command']); + safe_exec(escapeshellcmd($this->settings['system']['apachereload_command'])); } /** diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index 39b3b0a1..fdca8489 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -63,7 +63,7 @@ class lighttpd { fwrite($this->debugHandler, ' lighttpd::reload: reloading lighttpd' . "\n"); $this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading lighttpd'); - safe_exec($this->settings['system']['apachereload_command']); + safe_exec(escapeshellcmd($this->settings['system']['apachereload_command'])); } public function createIpPort()