summaryrefslogtreecommitdiffstats
path: root/etc/inc/pkg-utils.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfSense.org>2009-12-24 12:56:30 -0500
committerScott Ullrich <sullrich@pfSense.org>2009-12-24 12:57:03 -0500
commit4143a437a5a824011511f93ba1857d39ac51fb1d (patch)
tree761e6eeaab51855f9bd40f16851ab5bfa5aae715 /etc/inc/pkg-utils.inc
parentffe76308243d1bafa3489a72f958f553503fd72b (diff)
downloadpfsense-4143a437a5a824011511f93ba1857d39ac51fb1d.zip
pfsense-4143a437a5a824011511f93ba1857d39ac51fb1d.tar.gz
Nuke pkg_build_filter_rules(). It is not called anywhere in the code and adds complexity that I do not wish to see in the codebase
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r--etc/inc/pkg-utils.inc92
1 files changed, 1 insertions, 91 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 3bce107..8cabced 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -1002,94 +1002,4 @@ function squash_from_bytes($size, $round = "") {
return;
}
-function pkg_build_filter_rules() {
- global $config, $g;
-
-
- $pkgrules = "";
- $pkgrulesearly = "";
- $pkgnatrules = "";
- $pkgnatrulesearly = "";
- $pkgrdrrules = "";
- $pkgrdrrulesearly = "";
-
- if (is_array($config['installedpackages']['package'])) {
- run_plugins("/usr/local/pkg");
- foreach($config['installedpackages']['package'] as $pkg) {
- if (!isset($pkg['filter_rule_function']))
- continue;
- $tmpresult = call_user_func($pkg['filter_rule_function'], 'natearly');
- if (!empty($tmpresult))
- $pkgnatrulesearly .= $tmpresult . " \n";
- $tmpresult = call_user_func($pkg['filter_rule_function'], 'nat');
- if (!empty($tmpresult))
- $pkgnatrules .= $tmpresult . " \n";
- $tmpresult = call_user_func($pkg['filter_rule_function'], 'ruleearly');
- if (!empty($tmpresult))
- $pkgrulesearly .= $tmpresult . " \n";
- $tmpresult = call_user_func($pkg['filter_rule_function'], 'rule');
- if (!empty($tmpresult))
- $pkgrules .= $tmpresult . " \n";
- $tmpresult = call_user_func($pkg['filter_rule_function'], 'rdrearly');
- if (!empty($tmpresult))
- $pkgrdrrulesearly .= $tmpresult . " \n";
- $tmpresult = call_user_func($pkg['filter_rule_function'], 'rdr');
- if (!empty($tmpresult))
- $pkgrdrrules .= $tmpresult . " \n";
-
- }
- }
- file_put_contents("{$g['tmp_path']}/rules.natearly.packages", $pkgnatrulesearly);
- file_put_contents("{$g['tmp_path']}/rules.nat.packages", $pkgnatrules);
- file_put_contents("{$g['tmp_path']}/rules.rulesearly.packages", $pkgrulesearly);
- file_put_contents("{$g['tmp_path']}/rules.packages", $pkgrules);
- file_put_contents("{$g['tmp_path']}/rules.rdr.packages", $pkgrdrrules);
- file_put_contents("{$g['tmp_path']}/rules.rdrearly.packages", $pkgrdrrulesearly);
- $error = "";
- $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.natearly.packages");
- if ($status <> 0) {
- $errornatearly = "There was an error while parsing the NAT early package rules.\n";
- $error .= $errornatearly;
- log_error($errornatearly);
- file_put_contents("{$g['tmp_path']}/rules.natearly.packages", "#{$errornatearly}\n");
- }
- $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.nat.packages");
- if ($status <> 0) {
- $errornat = "There was an error while parsing the NAT package rules.\n";
- $error .= $errornat;
- log_error($errornat);
- file_put_contents("{$g['tmp_path']}/rules.nat.packages", "#{$errornat}\n");
- }
- $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.rulesearly.packages");
- if ($status <> 0) {
- $errorrulesearly = "There was an error while parsing the package filter early rules.\n";
- $error .= $errorrulesearly;
- log_error($errorrulesearly);
- file_put_contents("{$g['tmp_path']}/rules.rulesearly.packages", "#{$errorrulesearly}\n");
- }
- $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.packages");
- if ($status <> 0) {
- $errorrules = "There was an error while parsing the package filter rules.\n";
- $error .= $errorrules;
- log_error($errorrules);
- file_put_contents("{$g['tmp_path']}/rules.packages", "#{$errorrules}\n");
- }
- $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.rdrearly.packages");
- if ($status <> 0) {
- $errorrdrearly = "There was an error while parsing the RDR early package rules.\n";
- $error .= $errorrdrearly;
- log_error($errorrdrearly);
- file_put_contents("{$g['tmp_path']}/rules.rdrearly.packages", "#{$errorrdrearly}\n");
- }
- $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.rdr.packages");
- if ($status <> 0) {
- $errorrdr = "There was an error while parsing the RDR package rules.\n";
- $error .= $errorrdr;
- log_error($errorrdr);
- file_put_contents("{$g['tmp_path']}/rules.rdr.packages", "#{$errorrdr}\n");
- }
- if ($error <> "")
- file_notice($error);
-}
-
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud