aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-11-11 13:42:40 +0000
committerErmal <eri@pfsense.org>2011-11-11 13:42:40 +0000
commit2e9362c5ab08a858759cd65f01409248ea602639 (patch)
tree2ea35b819746916be24c456744c3c75ab9b9367e
parent5becc5aa5efda18cc0a69e3664738fe3d3d23149 (diff)
downloadpfsense-packages-2e9362c5ab08a858759cd65f01409248ea602639.tar.gz
pfsense-packages-2e9362c5ab08a858759cd65f01409248ea602639.tar.bz2
pfsense-packages-2e9362c5ab08a858759cd65f01409248ea602639.zip
Use basename to be sure that no full path is used on the files themselves
-rw-r--r--config/snort/snort.inc2
-rw-r--r--config/snort/snort_rules.php2
-rw-r--r--config/snort/snort_rulesets.php14
3 files changed, 6 insertions, 12 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc
index e0f90582..72be9191 100644
--- a/config/snort/snort.inc
+++ b/config/snort/snort.inc
@@ -354,7 +354,7 @@ function snort_file_list($snort_log_dir, $snort_log_file)
$dir = opendir ("$snort_log_dir");
while (false !== ($file = readdir($dir))) {
if (strpos($file, "$snort_log_file",1) )
- $file_list[] = $file;
+ $file_list[] = basename($file);
}
return $file_list;
}
diff --git a/config/snort/snort_rules.php b/config/snort/snort_rules.php
index 2aa49865..871eb39e 100644
--- a/config/snort/snort_rules.php
+++ b/config/snort/snort_rules.php
@@ -157,7 +157,7 @@ while (false !== ($filename = readdir($dh)))
//only populate this array if its a rule file
$isrulefile = strstr($filename, ".rules");
if ($isrulefile !== false)
- $files[] = $filename;
+ $files[] = basename($filename);
}
sort($files);
diff --git a/config/snort/snort_rulesets.php b/config/snort/snort_rulesets.php
index 9e3853f5..e4577818 100644
--- a/config/snort/snort_rulesets.php
+++ b/config/snort/snort_rulesets.php
@@ -136,16 +136,10 @@ $d_snortconfdirty_path = "/var/run/snort_conf_{$iface_uuid}_{$if_real}.dirty";
if ($_POST["Submit"]) {
$enabled_items = "";
$isfirst = true;
- if (is_array($_POST['toenable'])) {
- foreach($_POST['toenable'] as $toenable) {
- if(!$isfirst)
- $enabled_items .= "||";
- $enabled_items .= "{$toenable}";
- $isfirst = false;
- }
- }else{
+ if (is_array($_POST['toenable']))
+ $enabled_items = implode("||", $_POST['toenable']);
+ else
$enabled_items = $_POST['toenable'];
- }
$a_nat[$id]['rulesets'] = $enabled_items;
write_config();
@@ -256,7 +250,7 @@ if (file_exists($d_snortconfdirty_path)) {
$dir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/";
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
- $files[] = $filename;
+ $files[] = basename($filename);
}
sort($files);
foreach($files as $file) {