diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2013-04-09 20:10:36 -0400 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2013-04-09 20:10:36 -0400 |
commit | 31905aef52131b7067441f8f7902b343a4588f72 (patch) | |
tree | 4ebcd588d4877f3a22f8f7d31132203703d554a2 /config/snort/snort_interfaces_edit.php | |
parent | 6cabee346e055501e39886fb2b3fddbb4799fcdb (diff) | |
download | pfsense-packages-31905aef52131b7067441f8f7902b343a4588f72.tar.gz pfsense-packages-31905aef52131b7067441f8f7902b343a4588f72.tar.bz2 pfsense-packages-31905aef52131b7067441f8f7902b343a4588f72.zip |
Update Snort to 2.5.5 - New features and bug fixes
Diffstat (limited to 'config/snort/snort_interfaces_edit.php')
-rwxr-xr-x | config/snort/snort_interfaces_edit.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/config/snort/snort_interfaces_edit.php b/config/snort/snort_interfaces_edit.php index d0fabbf4..76763553 100755 --- a/config/snort/snort_interfaces_edit.php +++ b/config/snort/snort_interfaces_edit.php @@ -31,7 +31,7 @@ require_once("guiconfig.inc"); require_once("/usr/local/pkg/snort/snort.inc"); -global $g; +global $g, $rebuild_rules; if (!is_array($config['installedpackages']['snortglobal'])) $config['installedpackages']['snortglobal'] = array(); @@ -50,10 +50,15 @@ if (is_null($id)) { } $pconfig = array(); -if (empty($snortglob['rule'][$id]['uuid'])) +if (empty($snortglob['rule'][$id]['uuid'])) { + /* Adding new interface, so flag rules to build. */ $pconfig['uuid'] = snort_generate_id(); -else + $rebuild_rules = "on"; +} +else { $pconfig['uuid'] = $a_rule[$id]['uuid']; + $rebuild_rules = "off"; +} $snort_uuid = $pconfig['uuid']; if (isset($id) && $a_rule[$id]) { @@ -77,14 +82,6 @@ if ($_POST["Submit"]) { if (!$_POST['interface']) $input_errors[] = "Interface is mandatory"; -/* - foreach ($a_rule as $natent) { - if (isset($id) && ($a_rule[$id]) && ($a_rule[$id] === $natent)) - continue; - if ($natent['interface'] == $_POST['interface']) - $input_errors[] = "This interface is already configured for another instance"; - } -*/ /* if no errors write to conf */ if (!$input_errors) { @@ -118,10 +115,16 @@ if ($_POST["Submit"]) { } else $a_rule[] = $natent; + /* If Snort is disabled on this interface, stop any running instance */ if ($natent['enable'] != 'on') snort_stop($natent, $if_real); + + /* Save configuration changes */ write_config(); - sync_snort_package_config(); + + /* Update snort.conf file for this interface */ + $rebuild_rules = "off"; + snort_generate_conf($a_rule[$id]); header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); |