From 958efd439784459a5848fb05afe1560c4db285d7 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 9 Jul 2012 12:57:00 -0400 Subject: 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. --- config/snort/snort_rulesets.php | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'config/snort/snort_rulesets.php') diff --git a/config/snort/snort_rulesets.php b/config/snort/snort_rulesets.php index b08d7e6f..788b2fbc 100644 --- a/config/snort/snort_rulesets.php +++ b/config/snort/snort_rulesets.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(); @@ -64,9 +64,9 @@ $pgtitle = "Snort: Interface $id $iface_uuid $if_real Categories"; /* Check if the rules dir is empy if so warn the user */ /* TODO give the user the option to delete the installed rules 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("fbegin.inc"); @@ -105,7 +105,7 @@ if ($isrulesfolderempty == "") { \n \n \n \n
\n - # The rules directory is empty. {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules \n + # The rules directory is empty. /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules \n
\n @@ -127,7 +127,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); } } @@ -167,7 +167,19 @@ include_once("head.inc"); ' . $pgtitle . '

';}?> + +
+ + + "; @@ -234,8 +246,9 @@ if (file_exists($d_snortconfdirty_path)) { - \n"; echo "\n"; echo "\n"; - echo "{$file}\n"; + echo "{$file}\n"; echo "\n\n\n"; + //echo ""; + //echo "description"; + //echo ""; } - ?> + + ?> @@ -280,11 +297,17 @@ if (file_exists($d_snortconfdirty_path)) { + +

NOTE: You can click on a ruleset name to edit the ruleset.

+
+ + -- cgit v1.2.3