From c6e05a8eebc58624c675d4b10d33e94e6b6fa83b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 12 Sep 2011 10:16:19 -0400
Subject: [PATCH] Implemented: FS#1385 - Define all Email aliases in dovecot autoresponder

---
 server/mods-available/rescue_core_module.inc.php |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/server/mods-available/rescue_core_module.inc.php b/server/mods-available/rescue_core_module.inc.php
index 0763965..f1c34ca 100644
--- a/server/mods-available/rescue_core_module.inc.php
+++ b/server/mods-available/rescue_core_module.inc.php
@@ -89,14 +89,14 @@
 		$this->_rescueData = $this->_getRescueData();
 		
 		/*
+		 * rescue mysql if needed (maybe apache depends on mysql, so try this first!)
+		 */
+		$this->_rescueMySql();
+		
+		/*
 		 * rescue apache if needed
 		 */
 		$this->_rescueApache();
-		
-		/*
-		 * rescue mysql if needed
-		 */
-		$this->_rescueMySql();
 		
 		/*
 		 * The last step is to save the rescue-data
@@ -161,8 +161,10 @@
 		
 		/*
 		 * We have the newest monitoring data. Save it!
+		 * (and protect it, because there may be sensible data in it)
 		 */
 		file_put_contents($dataFilename, serialize($data));
+		chmod($dataFilename, 0600);
 						
 		/* Thats it */
 		return $data;
@@ -207,7 +209,12 @@
 	 */
 	private function _saveRescueData() {
 		$dataFilename = dirname(__FILE__) . "/../temp/rescue_module_rescuedata.ser.txt";
+		/*
+		 * We have the newest data. Save it!
+		 * (and protect it, because there may be sensible data in it)
+		 */
 		file_put_contents($dataFilename, serialize($this->_rescueData));
+		chmod($dataFilename, 0600);
 	}
 
 	/**
@@ -266,7 +273,6 @@
 		
 		
 		$app->log('Apache is down! Try rescue apache (try:' . $tryCount . ')...', LOGLEVEL_WARN);
-//		echo 'Apache is down! Try rescue apache (try:' . $tryCount . ')...';
 
 		if(is_file($conf['init_scripts'] . '/' . 'httpd')) {
 			$daemon = 'httpd';
@@ -333,7 +339,6 @@
 		
 		
 		$app->log('MySQL is down! Try rescue mysql (try:' . $tryCount . ')...', LOGLEVEL_WARN);
-//		echo 'MySQL is down! Try rescue mysql (try:' . $tryCount . ')...';
 
 		if(is_file($conf['init_scripts'] . '/' . 'mysqld')) {
 			$daemon = 'mysqld';

--
Gitblit v1.9.1