aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_rules.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-07-09 12:57:00 -0400
committerjim-p <jimp@pfsense.org>2012-07-09 12:57:00 -0400
commit958efd439784459a5848fb05afe1560c4db285d7 (patch)
tree1e836cb827156bba4cc12ad37fc21294f138e7f8 /config/snort/snort_rules.php
parent4e8dd82f957006899f1babb2e521b8fd3cdcd2ce (diff)
downloadpfsense-packages-958efd439784459a5848fb05afe1560c4db285d7.tar.gz
pfsense-packages-958efd439784459a5848fb05afe1560c4db285d7.tar.bz2
pfsense-packages-958efd439784459a5848fb05afe1560c4db285d7.zip
globals for these do not work properly at bootup. Might be causing unintended overwrites/deletions. Revert "s//usr/local/etc/snort/snortdir/ to unify its reference and location. Trim some unused functions in the way"
This reverts commit 40cace16a452cd841a6b3626c44ff0d0b655956f.
Diffstat (limited to 'config/snort/snort_rules.php')
-rw-r--r--config/snort/snort_rules.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/config/snort/snort_rules.php b/config/snort/snort_rules.php
index 56c68980..c4e149b3 100644
--- a/config/snort/snort_rules.php
+++ b/config/snort/snort_rules.php
@@ -33,7 +33,7 @@ require_once("guiconfig.inc");
require_once("/usr/local/pkg/snort/snort_gui.inc");
require_once("/usr/local/pkg/snort/snort.inc");
-global $g, $snortdir;
+global $g;
if (!is_array($config['installedpackages']['snortglobal']['rule']))
$config['installedpackages']['snortglobal']['rule'] = array();
@@ -59,12 +59,12 @@ $iface_uuid = $a_nat[$id]['uuid'];
/* Check if the rules dir is empy if so warn the user */
/* TODO give the user the option to delete the installed rules rules */
-if (!is_dir("{$snortdir}/snort_{$iface_uuid}_{$if_real}/rules"))
- exec("/bin/mkdir -p {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules");
+if (!is_dir("/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules"))
+ exec("/bin/mkdir -p /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules");
-$isrulesfolderempty = exec("ls -A {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/*.rules");
+$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/*.rules");
if ($isrulesfolderempty == "") {
- $isrulesfolderempty = exec("ls -A {$snortdir}/rules/*.rules");
+ $isrulesfolderempty = exec("ls -A /usr/local/etc/snort/rules/*.rules");
if ($isrulesfolderempty == "") {
include_once("head.inc");
include_once("fbegin.inc");
@@ -123,7 +123,7 @@ if ($isrulesfolderempty == "") {
exit(0);
} else {
/* Make sure that we have the rules */
- mwexec("/bin/cp {$snortdir}/rules/*.rules {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules", true);
+ mwexec("/bin/cp /usr/local/etc/snort/rules/*.rules /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules", true);
}
}
@@ -149,7 +149,8 @@ function load_rule_file($incoming_file)
return explode("\n", $contents);
}
-$ruledir = "{$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/";
+$ruledir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/";
+//$ruledir = "/usr/local/etc/snort/rules/";
$dh = opendir($ruledir);
while (false !== ($filename = readdir($dh)))
{