diff --git a/scripts/jobs/cron_tasks.php b/scripts/jobs/cron_tasks.php index 1426916a..41e0bb1a 100644 --- a/scripts/jobs/cron_tasks.php +++ b/scripts/jobs/cron_tasks.php @@ -324,6 +324,20 @@ while($row = $db->fetch_array($result_tasks)) safe_exec('rm -rf '.escapeshellarg($maildir)); } + /* + * remove tmpdir if it exists + */ + $tmpdir = makeCorrectDir($settings['system']['mod_fcgid_tmpdir'] . '/' . $row['data']['loginname'] . '/'); + + if (is_dir($tmpdir) + && $tmpdir != "/" + && $tmpdir != $settings['system']['mod_fcgid_tmpdir'] + && substr($tmpdir, 0, strlen($settings['system']['mod_fcgid_tmpdir'])) == $settings['system']['mod_fcgid_tmpdir']) + { + $cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($tmpdir)); + safe_exec('rm -rf '.escapeshellarg($tmpdir)); + } + /* * see if we have some php-fcgid leftovers if used * and remove them, #200