aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_blocked.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/snort/snort_blocked.php')
-rw-r--r--config/snort/snort_blocked.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/config/snort/snort_blocked.php b/config/snort/snort_blocked.php
index 0f95f8ce..2d0af2c3 100644
--- a/config/snort/snort_blocked.php
+++ b/config/snort/snort_blocked.php
@@ -89,9 +89,9 @@ if ($_POST['download'])
exec('/sbin/pfctl -t snort2c -T show', $blocked_ips_array_save);
/* build the list */
if (is_array($blocked_ips_array_save) && count($blocked_ips_array_save) > 0) {
- $save_date = exec('/bin/date "+%Y-%m-%d-%H-%M-%S"');
+ $save_date = date("Y-m-d-H-i-s");
$file_name = "snort_blocked_{$save_date}.tar.gz";
- exec('/bin/mkdir -p /tmp/snort_blocked');
+ safe_mkdir("/tmp/snort_blocked");
file_put_contents("/tmp/snort_blocked/snort_block.pf", "");
foreach($blocked_ips_array_save as $counter => $fileline) {
if (empty($fileline))
@@ -120,8 +120,8 @@ if ($_POST['download'])
readfile("/tmp/{$file_name}");
// Clean up the temp files and directory
- @unlink("/tmp/{$file_name}");
- exec("/bin/rm -fr /tmp/snort_blocked");
+ unlink_if_exists("/tmp/{$file_name}");
+ rmdir_recursive("/tmp/snort_blocked");
} else
$savemsg = gettext("An error occurred while creating archive");
} else