From c3b3ace436cfc9f0cc0ea7e5909c58582b7ed658 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Sun, 12 Jan 2014 00:25:54 -0500 Subject: Ensure conf_mount_rw() and conf_mount_ro() are used where needed. --- config/snort/snort_alerts.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config/snort/snort_alerts.php') diff --git a/config/snort/snort_alerts.php b/config/snort/snort_alerts.php index 2b957f61..97174cdd 100755 --- a/config/snort/snort_alerts.php +++ b/config/snort/snort_alerts.php @@ -221,16 +221,17 @@ if ($_GET['action'] == "clear" || $_POST['delete']) { $fd = @fopen("/var/log/snort/snort_{$if_real}{$snort_uuid}/alert", "w+"); if ($fd) fclose($fd); - conf_mount_ro(); /* XXX: This is needed if snort is run as snort user */ mwexec('/bin/chmod 660 /var/log/snort/*', true); if (file_exists("{$g['varrun_path']}/snort_{$if_real}{$snort_uuid}.pid")) mwexec("/bin/pkill -HUP -F {$g['varrun_path']}/snort_{$if_real}{$snort_uuid}.pid -a"); + conf_mount_ro(); header("Location: /snort/snort_alerts.php?instance={$instanceid}"); exit; } if ($_POST['download']) { + conf_mount_rw(); $save_date = exec('/bin/date "+%Y-%m-%d-%H-%M-%S"'); $file_name = "snort_logs_{$save_date}_{$if_real}.tar.gz"; exec("cd /var/log/snort/snort_{$if_real}{$snort_uuid} && /usr/bin/tar -czf /tmp/{$file_name} *"); @@ -255,6 +256,8 @@ if ($_POST['download']) { } else $savemsg = gettext("An error occurred while creating archive"); + + conf_mount_ro(); } /* Load up an array with the current Suppression List GID,SID values */ -- cgit v1.2.3