From 849624af667b7090fcbcf56d7d6a28d5a2c029d6 Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Tue, 29 Mar 2011 07:00:35 -0400
Subject: [PATCH] protect the content of the temporary data of the rescue-module

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

diff --git a/server/mods-available/rescue_core_module.inc.php b/server/mods-available/rescue_core_module.inc.php
index 0763965..6a86344 100644
--- a/server/mods-available/rescue_core_module.inc.php
+++ b/server/mods-available/rescue_core_module.inc.php
@@ -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);
 	}
 
 	/**

--
Gitblit v1.9.1