From 7d7a5b66b63cdce23661c1e7e76643ffc196db26 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 3 Aug 2011 08:50:45 +0000 Subject: Check that wrong input is not posted on the final config file. Let the pacakge system handle removing of freebsd packages. When starting stopping from the Snort Interfaces screen sync the configuration as well. --- config/snort/snort.inc | 12 +++++------- config/snort/snort_interfaces.php | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index ab6d2e64..61fe4a70 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -123,8 +123,10 @@ function build_base_whitelist($build_netlist, $wanip, $wangw, $wandns, $vips, $v /* calculate interface subnet information */ if (function_exists('get_interface_ip')) { $subnet = get_interface_ip($int); - $sn = get_interface_subnet($int); - $home_net .= "{$subnet}/{$sn} "; + if (is_ipaddr($subnet)) { + $sn = get_interface_subnet($int); + $home_net .= "{$subnet}/{$sn} "; + } } else { $ifcfg = $config['interfaces'][$int]; switch ($ifcfg['ipaddr']) { @@ -1646,11 +1648,6 @@ function snort_deinstall() sleep(2); mwexec('/usr/sbin/pw userdel snort; /usr/sbin/pw groupdel snort', true); mwexec('/bin/rm -rf /usr/local/etc/snort*; /bin/rm -rf /usr/local/pkg/snort*; /bin/rm -rf /usr/local/pkg/pf/snort*', true); - - /* XXX */ - mwexec("/usr/sbin/pkg_delete -x snort", true); - mwexec("/usr/sbin/pkg_delete -x perl-threaded", true); - mwexec("/usr/sbin/pkg_delete -x mysql-client-5.1.50_1", true); mwexec('/bin/rm -r /usr/local/bin/barnyard2', true); mwexec('/bin/rm -rf /usr/local/www/snort; /bin/rm -rf /usr/local/lib/snort; /bin/rm -rf /var/log/snort; /bin/rm -rf /usr/local/pkg/snort, true'); @@ -1769,6 +1766,7 @@ function generate_snort_conf($id, $if_real, $snort_uuid) } /* define threshold file */ + $threshold_file_name = ""; if ($snortcfg['suppresslistname'] != 'default') { if (preg_match('/^([a-zA-z0-9]+)/', $snortcfg['suppresslistname'], $slist_name_file2)) { $threshold_name = $slist_name_file2[0]; diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index 337e50ac..a192ca43 100644 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -141,6 +141,8 @@ if ($_GET['act'] == 'toggle' && is_numeric($id)) { /* Log Iface stop */ exec("/usr/bin/logger -p daemon.info -i -t SnortStartup 'Toggle for {$snort_uuid}_{$if_real}...'"); + sync_snort_package_all($id, $if_real, $snort_uuid); + $tester2 = Running_Ck($snort_uuid, $if_real, $id); if ($tester2 == 'yes') { @@ -159,7 +161,6 @@ if ($_GET['act'] == 'toggle' && is_numeric($id)) { }else{ - sync_snort_package_all($id, $if_real, $snort_uuid); Running_Start($snort_uuid, $if_real, $id); header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); -- cgit v1.2.3