File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
server/lib/classes/cron.d Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,14 @@ public function onRunJob() {
7474
7575 //* mount backup directory, if necessary
7676 $ run_backups = true ;
77- $ server_config ['backup_dir_mount_cmd ' ] = trim ($ server_config ['backup_dir_mount_cmd ' ]);
78- if ($ server_config ['backup_dir_is_mount ' ] == 'y ' && $ server_config ['backup_dir_mount_cmd ' ] != '' ){
79- if (!$ app ->system ->is_mounted ($ backup_dir )){
80- exec (escapeshellcmd ($ server_config ['backup_dir_mount_cmd ' ]));
77+ $ backup_dir_mount_cmd = '/usr/local/ispconfig/server/scripts/backup_dir_mount.sh ' ;
78+ if ( $ server_config ['backup_dir_is_mount ' ] == 'y ' &&
79+ is_file ($ backup_dir_mount_cmd ) &&
80+ is_executable ($ backup_dir_mount_cmd ) &&
81+ fileowner ($ backup_dir_mount_cmd ) === 0
82+ ){
83+ if (!$ app ->system ->is_mounted ($ backup_dir )){
84+ exec ($ backup_dir_mount_cmd );
8185 sleep (1 );
8286 if (!$ app ->system ->is_mounted ($ backup_dir )) $ run_backups = false ;
8387 }
Original file line number Diff line number Diff line change @@ -61,10 +61,13 @@ public function onRunJob() {
6161 if ($ backup_dir != '' ) {
6262 //* mount backup directory, if necessary
6363 $ run_backups = true ;
64- $ server_config ['backup_dir_mount_cmd ' ] = trim ($ server_config ['backup_dir_mount_cmd ' ]);
65- if ($ server_config ['backup_dir_is_mount ' ] == 'y ' && $ server_config ['backup_dir_mount_cmd ' ] != '' ){
64+ if ( $ server_config ['backup_dir_is_mount ' ] == 'y ' &&
65+ is_file ($ backup_dir_mount_cmd ) &&
66+ is_executable ($ backup_dir_mount_cmd ) &&
67+ fileowner ($ backup_dir_mount_cmd ) === 0
68+ ){
6669 if (!$ app ->system ->is_mounted ($ backup_dir )){
67- exec (escapeshellcmd ( $ server_config [ ' backup_dir_mount_cmd ' ]) );
70+ exec ($ backup_dir_mount_cmd );
6871 sleep (1 );
6972 if (!$ app ->system ->is_mounted ($ backup_dir )) $ run_backups = false ;
7073 }
You can’t perform that action at this time.
0 commit comments