aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_rulesets.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_rulesets.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_rulesets.php')
-rw-r--r--config/snort/snort_rulesets.php41
1 files changed, 32 insertions, 9 deletions
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 == "") {
<table id=\"maintable\" class=\"tabcont\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n
<tr>\n
<td>\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
</td>\n
</tr>\n
</table>\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");
<?php include("fbegin.inc"); ?>
<?if($pfsense_stable == 'yes'){echo '<p class="pgtitle">' . $pgtitle . '</p>';}?>
+<?php
+echo "{$snort_general_css}\n";
+?>
+
<div class="body2">
+
+<noscript>
+<div class="alert" ALIGN=CENTER><img
+ src="../themes/<?php echo $g['theme']; ?>/images/icons/icon_alert.gif" /><strong>Please
+enable JavaScript to view this content
+</CENTER></div>
+</noscript>
+
<?php
echo "<form action=\"snort_rulesets.php?id={$id}\" method=\"post\" name=\"iform\" id=\"iform\">";
@@ -234,8 +246,9 @@ if (file_exists($d_snortconfdirty_path)) {
<td class="listhdrr"><?php if($snort_arch == 'x86'){echo 'Ruleset: Rules that end with "so.rules" are shared object rules.';}else{echo 'Shared object rules are "so.rules" and not available on 64 bit architectures.';}?></td>
<!-- <td class="listhdrr">Description</td> -->
</tr>
- <?php
- $dh = opendir("{$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/");
+ <?php
+ $dir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/";
+ $dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
$files[] = basename($filename);
}
@@ -256,10 +269,14 @@ if (file_exists($d_snortconfdirty_path)) {
echo " \n<input type='checkbox' name='toenable[]' value='$file' {$CHECKED} />\n";
echo "</td>\n";
echo "<td>\n";
- echo "<a href='snort_rules.php?id={$id}&openruleset={$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/" . urlencode($file) . "'>{$file}</a>\n";
+ echo "<a href='snort_rules.php?id={$id}&openruleset=/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/" . urlencode($file) . "'>{$file}</a>\n";
echo "</td>\n</tr>\n\n";
+ //echo "<td>";
+ //echo "description";
+ //echo "</td>";
}
- ?>
+
+ ?>
</table>
</td>
</tr>
@@ -280,11 +297,17 @@ if (file_exists($d_snortconfdirty_path)) {
</td>
</tr>
</table>
+
</form>
+
<p><b>NOTE:</b> You can click on a ruleset name to edit the ruleset.</p>
+
</div>
+
<?php
include("fend.inc");
+echo $snort_custom_rnd_box;
?>
+
</body>
</html>