summaryrefslogtreecommitdiffstats
path: root/etc/inc/filter.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-05-05 20:56:23 +0000
committerErmal <eri@pfsense.org>2010-05-05 20:56:23 +0000
commit7a31647e979d2f2156f31d5db7f8c9337d58a2fa (patch)
tree7488af282bc257d340cf312153d627e9f959dd3c /etc/inc/filter.inc
parent8ba13f00b8e58a42f2bc2a48fad835260decf299 (diff)
downloadpfsense-7a31647e979d2f2156f31d5db7f8c9337d58a2fa.zip
pfsense-7a31647e979d2f2156f31d5db7f8c9337d58a2fa.tar.gz
Ticket #511. Do not penailize other packages if rules of one package are erroneous during package rule generation.
Diffstat (limited to 'etc/inc/filter.inc')
-rw-r--r--etc/inc/filter.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index e0ed52c..5fe7d56 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -2530,8 +2530,11 @@ EOD;
function discover_pkg_rules($ruletype) {
global $config, $g;
+
if(!is_dir("/usr/local/pkg"))
return "";
+
+ $rules = "";
$files = split("\n", trim(`ls /usr/local/pkg/*.inc`));
foreach($files as $pkg_inc) {
if($pkg_inc == "ls: No match.")
@@ -2542,15 +2545,16 @@ function discover_pkg_rules($ruletype) {
$pkg_generate_rules = "{$pkg}_generate_rules";
if(function_exists($pkg_generate_rules)) {
update_filter_reload_status("Processing early {$ruletype} rules for package {$pkg_inc}");
- $rules .= $pkg_generate_rules("$ruletype");
- file_put_contents("{$g['tmp_path']}/rules.packages", $rules);
- $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.packages");
+ $tmprules = $pkg_generate_rules("$ruletype");
+ file_put_contents("{$g['tmp_path']}/rules.test.packages", $tmprules);
+ $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.test.packages");
if ($status <> 0) {
$errorrules = "There was an error while parsing the package filter rules for {$pkg_inc}.\n";
log_error($errorrules);
file_put_contents("{$g['tmp_path']}/rules.packages.{$pkg_inc}", "#{$errorrules}\n");
- return "";
+ continue;
}
+ $rules .= $tmprules;
}
}
return $rules;
OpenPOWER on IntegriCloud