From 061d7c84c49b9e63c311123f52a142fc66b4228f Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Tue, 29 Jul 2014 10:59:19 -0400
Subject: [PATCH] Removed backup_dir_mount_cmd option from Sysstem > server config. The option has been replaced by a script /usr/local/ispconfig/server/scripts/backup_dir_mount.sh. If this script exists, is exacutable and is owned by the root user, then it will be executed upfront of the backup jobs when the option "Backup directory is a mount?" is enabled in server config settings.

---
 server/cron_daily.php |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/cron_daily.php b/server/cron_daily.php
index 75459be..ee54a46 100644
--- a/server/cron_daily.php
+++ b/server/cron_daily.php
@@ -1104,10 +1104,14 @@
 	
 	//* mount backup directory, if necessary
 	$run_backups = true;
-	$server_config['backup_dir_mount_cmd'] = trim($server_config['backup_dir_mount_cmd']);
-	if($server_config['backup_dir_is_mount'] == 'y' && $server_config['backup_dir_mount_cmd'] != ''){
+	$backup_dir_mount_cmd = '/usr/local/ispconfig/server/scripts/backup_dir_mount.sh';
+	if(	$server_config['backup_dir_is_mount'] == 'y' && 
+		is_file($backup_dir_mount_cmd) && 
+		is_executable($backup_dir_mount_cmd) &&
+		fileowner($backup_dir_mount_cmd) === 0
+		){
 		if(!$app->system->is_mounted($backup_dir)){
-			exec(escapeshellcmd($server_config['backup_dir_mount_cmd']));
+			exec($backup_dir_mount_cmd);
 			sleep(1);
 			if(!$app->system->is_mounted($backup_dir)) $run_backups = false;
 		}

--
Gitblit v1.9.1