diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2014-09-17 20:49:00 -0400 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2014-09-17 20:49:00 -0400 |
commit | d952d1ee53bae2150c789fe86ee6673eb0c6d262 (patch) | |
tree | 99f240150ab8898048155e2ce78422d76d2532c9 /config/snort/snort.inc | |
parent | f7f5c7bb21c94f6be6b36202a8fa301d86a66406 (diff) | |
download | pfsense-packages-d952d1ee53bae2150c789fe86ee6673eb0c6d262.tar.gz pfsense-packages-d952d1ee53bae2150c789fe86ee6673eb0c6d262.tar.bz2 pfsense-packages-d952d1ee53bae2150c789fe86ee6673eb0c6d262.zip |
Use Snort description for service descr or friendly descr otherwise.
Diffstat (limited to 'config/snort/snort.inc')
-rwxr-xr-x | config/snort/snort.inc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 466efac1..e9feec1a 100755 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -1036,13 +1036,13 @@ function sync_snort_package_config() { if ($value['enable'] != 'on') { foreach ($config['installedpackages']['service'] as $key => $service) { if (isset($service['uuid']) && $service['uuid'] == $value['uuid'] && - $service['name'] == "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($value['interface']))) { + $service['name'] == "snort_" . strtolower($value['interface'])) { unset($config['installedpackages']['service'][$key]); unlink_if_exists("{$g['varrun_path']}/snort_{$uuid}.disabled"); $is_dirty = TRUE; } if (isset($service['uuid']) && $service['uuid'] == $value['uuid'] && - $service['name'] == "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($value['interface']))) { + $service['name'] == "barnyard2_" . strtolower($value['interface'])) { unset($config['installedpackages']['service'][$key]); unlink_if_exists("{$g['varrun_path']}/barnyard2_{$uuid}.disabled"); $is_dirty = TRUE; @@ -1065,18 +1065,21 @@ function sync_snort_package_config() { $barnyard_found = FALSE; foreach ($config['installedpackages']['service'] as $service) { if (isset($service['uuid']) && $service['uuid'] == $value['uuid'] && - $service['name'] == "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($value['interface']))) { + $service['name'] == "snort_" . strtolower($value['interface'])) { $snort_found = TRUE; } if (isset($service['uuid']) && $service['uuid'] == $value['uuid'] && - $service['name'] == "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($value['interface']))) { + $service['name'] == "barnyard2_" . strtolower($value['interface'])) { $barnyard_found = TRUE; } } if (!$snort_found) { $service = array(); - $service['name'] = "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($value['interface'])); - $service['description'] = "Snort IDS/IPS - " . convert_friendly_interface_to_friendly_descr($value['interface']); + $service['name'] = "snort_" . strtolower($value['interface']); + if (!empty($value['descr'])) + $service['description'] = "Snort IDS - " . $value['descr']; + else + $service['description'] = "Snort IDS - " . convert_friendly_interface_to_friendly_descr($value['interface']); $service['uuid'] = $value['uuid']; $service['startcmd'] = "\$action='start';\$service='snort';\$uuid={$value['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; $service['stopcmd'] = "\$action='stop';\$service='snort';\$uuid={$value['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; @@ -1087,8 +1090,11 @@ function sync_snort_package_config() { } if (!$barnyard_found && $value['barnyard_enable'] == 'on') { $service = array(); - $service['name'] = "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($value['interface'])); - $service['description'] = "Barnyard2 Logging - " . convert_friendly_interface_to_friendly_descr($value['interface']); + $service['name'] = "barnyard2_" . strtolower($value['interface']); + if (!empty($value['descr'])) + $service['description'] = "Barnyard2 Logging - " . $value['descr']; + else + $service['description'] = "Barnyard2 Logging - " . convert_friendly_interface_to_friendly_descr($value['interface']); $service['uuid'] = $value['uuid']; $service['startcmd'] = "\$action='start';\$service='barnyard2';\$uuid={$value['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; $service['stopcmd'] = "\$action='stop';\$service='barnyard2';\$uuid={$value['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; |