aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev/snort_rules.php
diff options
context:
space:
mode:
authorrobiscool <robrob2626@yahoo.com>2011-06-23 12:41:33 -0700
committerrobiscool <robrob2626@yahoo.com>2011-06-23 12:41:33 -0700
commitfb9d497a232ec03a29053ba983fbc3d649fe3795 (patch)
tree13682b52e3dfd564b83af4f6773cc3898c2d08ee /config/snort-dev/snort_rules.php
parent967eefef1c5c9b6e4bbab43a611d77583b1ef2b2 (diff)
downloadpfsense-packages-fb9d497a232ec03a29053ba983fbc3d649fe3795.tar.gz
pfsense-packages-fb9d497a232ec03a29053ba983fbc3d649fe3795.tar.bz2
pfsense-packages-fb9d497a232ec03a29053ba983fbc3d649fe3795.zip
snort-dev, update install.inc, update snort_rules
Diffstat (limited to 'config/snort-dev/snort_rules.php')
-rw-r--r--config/snort-dev/snort_rules.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/config/snort-dev/snort_rules.php b/config/snort-dev/snort_rules.php
index 55cf47ac..8285c9fa 100644
--- a/config/snort-dev/snort_rules.php
+++ b/config/snort-dev/snort_rules.php
@@ -75,19 +75,15 @@ $snortRuleDir = '/usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid;
$filterDirList = snortScanDirFilter($snortRuleDir . '/rules', '\.rules');
// START read rule file
- if ($_GET['openruleset'])
- {
+ if ($_GET['openruleset']) {
$rulefile = $_GET['openruleset'];
}else{
$rulefile = $filterDirList[0];
}
+ // path of rule file
$workingFile = $snortRuleDir . '/rules/' . $rulefile;
- //split the contents of the string file into an array using the delimiter
- // used by rule gui edit and table build code
- $splitcontents = split_rule_file($workingFile);
-
function load_rule_file($incoming_file, $splitcontents)
{
@@ -119,15 +115,20 @@ function load_rule_file($incoming_file, $splitcontents)
return $splitcontents2;
}
-
- //Load the rule file
- $splitcontents2 = load_rule_file($workingFile, $splitcontents);
- $countSig = count($splitcontents2);
+ // Load the rule file
+ // split the contents of the string file into an array using the delimiter
+ // used by rule gui edit and table build code
+ if (filesize($workingFile) > 0) {
+ $splitcontents = split_rule_file($workingFile);
- if ($countSig > 0)
- {
- $newFilterRuleSigArray = newFilterRuleSig($splitcontents2);
+ $splitcontents2 = load_rule_file($workingFile, $splitcontents);
+
+ $countSig = count($splitcontents2);
+
+ if ($countSig > 0) {
+ $newFilterRuleSigArray = newFilterRuleSig($splitcontents2);
+ }
}
/*