aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-01-26 16:00:54 +0100
committerErmal <eri@pfsense.org>2013-01-26 16:00:54 +0100
commit71e82aa576c3969c35ae4394f4ee736cf8407af6 (patch)
tree9223bf7d2a2960cce918de5a985749a9d36081fe /config/snort
parentcf41ff359969913f1bc770bdaccb445630325ae8 (diff)
downloadpfsense-packages-71e82aa576c3969c35ae4394f4ee736cf8407af6.tar.gz
pfsense-packages-71e82aa576c3969c35ae4394f4ee736cf8407af6.tar.bz2
pfsense-packages-71e82aa576c3969c35ae4394f4ee736cf8407af6.zip
Correct checks
Diffstat (limited to 'config/snort')
-rwxr-xr-xconfig/snort/snort.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc
index f345e713..78d01ac3 100755
--- a/config/snort/snort.inc
+++ b/config/snort/snort.inc
@@ -1725,7 +1725,7 @@ function snort_prepare_rule_files($snortcfg, $snortcfgdir) {
/* rule category files if we have any. */
if (!empty($snortcfg['rulesets'])) {
foreach (explode("||", $snortcfg['rulesets']) as $file) {
- if (file_exists("{$snortdir}/rules/" . $file))
+ if (file_exists("{$snortdir}/rules/{$file}"))
$enabled_files[] = "{$snortdir}/rules/{$file}";
}
@@ -1736,7 +1736,7 @@ function snort_prepare_rule_files($snortcfg, $snortcfgdir) {
/* Remove any existing rules files (except custom rules) prior to building a new set. */
foreach (glob("{$snortcfgdir}/rules/*.rules") as $file) {
$tmpfile = basename($file);
- if (in_array($tmpfile, $enabled_files))
+ if (in_array("{$snortdir}/rules/{$tmpfile}", $enabled_files))
continue;
if (basename($tmpfile, ".rules") != "custom")
@unlink($file);
@@ -2187,7 +2187,8 @@ EOD;
@copy("/usr/local/lib/snort/dynamicpreprocessor/{$preproclib}.so", "{$snort_dirs['dynamicpreprocessor']}/{$preproclib}.so");
$snort_preprocessors .= $$preproc;
$snort_preprocessors .= "\n";
- }
+ } else
+ log_error("Could not find the {$preproclib} file. Snort might error out!");
} else {
$snort_preprocessors .= $$preproc;
$snort_preprocessors .= "\n";