From 7e96aa776c35ec4273b38874bf693c80684cfa12 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Oct 2006 00:46:43 +0000 Subject: Teach snort to use newer package plugin methods --- packages/snort/snort.inc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'packages/snort/snort.inc') diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc index 8773cac6..e27d8e4a 100644 --- a/packages/snort/snort.inc +++ b/packages/snort/snort.inc @@ -27,14 +27,12 @@ POSSIBILITY OF SUCH DAMAGE. */ -$snort_conf_file = "/usr/local/etc/snort/snort.conf"; - /* define oinkid */ if($config['installedpackages']['snort']) $oinkid = $config['installedpackages']['snort']['config'][0]['oinkmastercode']; function sync_package_snort() { - global $config, $g, $snort_conf_file; + global $config, $g; conf_mount_rw(); exec("/bin/mkdir -p /usr/local/etc/snort"); exec("/bin/mkdir -p /var/log/snort"); @@ -68,7 +66,7 @@ function sync_package_snort() { $start = "/bin/mkdir -p /var/log/snort"; /* start snort */ - $start .= ";snort -c {$snort_conf_file} -l /var/log/snort {$ifaces_final} -A full -D"; + $start .= ";snort -c /usr/local/etc/snort/snort.conf -l /var/log/snort {$ifaces_final} -A full -D"; /* if block offenders is checked, start snort2c */ if($_POST['blockoffenders']) @@ -90,13 +88,13 @@ function sync_package_snort() { } function create_snort_conf() { - global $config, $g, $snort_conf_file; + global $config, $g; /* write out snort.conf */ $snort_conf_text = generate_snort_conf(); conf_mount_rw(); - $conf = fopen($snort_conf_file, "w"); + $conf = fopen("/usr/local/etc/snort/snort.conf", "w"); if(!$conf) { - log_error("Could not open {$snort_conf_file} for writing."); + log_error("Could not open /usr/local/etc/snort/snort.conf for writing."); exit; } fwrite($conf, $snort_conf_text); @@ -105,7 +103,7 @@ function create_snort_conf() { } function generate_snort_conf() { - global $config, $g, $snort_conf_file; + global $config, $g; conf_mount_rw(); /* obtain external interface */ /* XXX: make multi wan friendly */ -- cgit v1.2.3