aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-09-15 12:10:48 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2014-09-15 12:10:48 -0400
commit64c45d6558c101ffe9bb743b60cb501ae82db842 (patch)
tree8c1ac785bf595ec0e8023273ef6120a54ddfd50e
parentced45d45bc7236f435df2ea215a4561ac7285fe9 (diff)
downloadpfsense-packages-64c45d6558c101ffe9bb743b60cb501ae82db842.tar.gz
pfsense-packages-64c45d6558c101ffe9bb743b60cb501ae82db842.tar.bz2
pfsense-packages-64c45d6558c101ffe9bb743b60cb501ae82db842.zip
Add test to prevent unneccessary call to write_config() when no changes.
-rw-r--r--config/snort/snort_post_install.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/config/snort/snort_post_install.php b/config/snort/snort_post_install.php
index ebf09864..2350050f 100644
--- a/config/snort/snort_post_install.php
+++ b/config/snort/snort_post_install.php
@@ -146,6 +146,7 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
/****************************************************************/
if (count($config['installedpackages']['snortglobal']['rule']) > 0) {
$uuids = array();
+ $fixed_duplicate = FALSE;
$snortconf = &$config['installedpackages']['snortglobal']['rule'];
foreach ($snortconf as &$snortcfg) {
// Check for and fix a duplicate UUID
@@ -164,10 +165,12 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
$snortcfg['uuid'] = $new_uuid;
$uuids[$new_uuid] = $if_real;
log_error(gettext("[Snort] updated UUID for interface " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']) . " from {$old_uuid} to {$new_uuid}."));
+ $fixed_duplicate = TRUE;
}
}
- write_config("Snort pkg: updated interface UUIDs to eliminate duplicates.");
- unset($uuids, $rulesets);
+ if ($fixed_duplicate)
+ write_config("Snort pkg: updated interface UUIDs to eliminate duplicates.");
+ unset($uuids);
}
/****************************************************************/
/* End of duplicate UUID bug fix. */
@@ -178,7 +181,7 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
include('/usr/local/pkg/snort/snort_migrate_config.php');
update_output_window(gettext("Please wait... rebuilding installation with saved settings..."));
log_error(gettext("[Snort] Downloading and updating configured rule types..."));
- update_output_window(gettext("Please wait... downloading and updating configured rule types..."));
+ update_output_window(gettext("Please wait... downloading and updating configured rule sets..."));
if ($pkg_interface <> "console")
$snort_gui_include = true;
include('/usr/local/pkg/snort/snort_check_for_rule_updates.php');
@@ -191,6 +194,7 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
$if_real = get_real_interface($snortcfg['interface']);
$snort_uuid = $snortcfg['uuid'];
$snortcfgdir = "{$snortdir}/snort_{$snort_uuid}_{$if_real}";
+ update_output_window(gettext("Generating configuration for " . convert_friendly_interface_to_friendly_descr($snortcfg['interface'])));
// Pull in the PHP code that generates the snort.conf file
// variables that will be substituted further down below.