summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-09-24 22:38:09 +0000
committerBill Marquette <billm@pfsense.org>2005-09-24 22:38:09 +0000
commitea22a5cabb1d6a655f3505e1ce4df0231966dd70 (patch)
treeef1dbdd73d63fc0bb3b5db023ff23fc5024bdc09 /etc
parent94130afc43dcc3ef2292a3feff918611ab6e1947 (diff)
downloadpfsense-ea22a5cabb1d6a655f3505e1ce4df0231966dd70.zip
pfsense-ea22a5cabb1d6a655f3505e1ce4df0231966dd70.tar.gz
Clean up hardcoded /tmp usage
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc26
1 files changed, 12 insertions, 14 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 9cf5a62..0d4e3d4 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -53,16 +53,14 @@ function filter_pflog_start() {
/* reload filter async */
function filter_configure() {
- touch("/tmp/filter_dirty");
+ touch("{$g['tmp_path']}/filter_dirty");
}
/* reload filter sync */
function filter_configure_sync() {
- if(file_exists("/tmp/filter_dirty"))
- unlink("/tmp/filter_dirty");
+ unlink_if_exists("{$g['tmp_path']}/filter_dirty");
- if(file_exists("/tmp/config.cache"))
- unlink("/tmp/config.cache");
+ unlink_if_exists("{$g['tmp_path']}/config.cache");
global $config, $g;
@@ -154,7 +152,7 @@ function filter_configure_sync() {
$rules_error = exec_command("/sbin/pfctl -f {$g['tmp_path']}/rules.debug");
$line_error = split("\:", $rules_error);
$line_number = $line_error[1];
- $rules_file = `/bin/cat /tmp/rules.debug`;
+ $rules_file = `/bin/cat {$g['tmp_path']}/rules.debug`;
$line_split = split("\n", $rules_file);
if(is_array($line_split))
$line_error = "The line in question reads [{$line_number}]: " . $line_split[$line_number-1];
@@ -1358,8 +1356,8 @@ function generate_user_filter_rule($rule, $ngcounter) {
* check to see if /tmp/{$rule['if']}_router exists. This file
* is created by dhclient for 2nd wan interfaces, etc.
*/
- if(file_exists("/tmp/{$rule['if']}_router"))
- $rg = file_get_contents("/tmp/{$rule['if']}_router");
+ if(file_exists("{$g['tmp_path']}/{$rule['if']}_router"))
+ $rg = file_get_contents("{$g['tmp_path']}/{$rule['if']}_router");
/* do not process reply-to for gateway'd rules */
if($rule['gateway'] == "") {
@@ -1381,10 +1379,10 @@ function generate_user_filter_rule($rule, $ngcounter) {
* from /tmp/router_bleh.router
*/
if(in_array($gateway, $ifdescrs)==true) {
- if(is_file("{$g["tmp_path"]}/{$gateway}_router")) {
- $return_gateway = file_get_contents("{$g["tmp_path"]}/{$gateway}_router");
+ if(is_file("{$g['tmp_path']}/{$gateway}_router")) {
+ $return_gateway = file_get_contents("{$g['tmp_path']}/{$gateway}_router");
} else {
- log_error("Could not find {$g["tmp_path"]}/{$gateway}_router. Needed for dhcp gateway information");
+ log_error("Could not find {$g['tmp_path']}/{$gateway}_router. Needed for dhcp gateway information");
continue;
}
}
@@ -1429,11 +1427,11 @@ function generate_user_filter_rule($rule, $ngcounter) {
*/
if(in_array($gateway, $ifdescrs)==true) {
$int=filter_opt_interface_to_real($gateway);
- if(is_file("{$g["tmp_path"]}/{$int}_router")) {
- $gatewayip = file_get_contents("{$g["tmp_path"]}/{$int}_router");
+ if(is_file("{$g['tmp_path']}/{$int}_router")) {
+ $gatewayip = file_get_contents("{$g['tmp_path']}/{$int}_router");
$line .= " route-to ( " . $int . " " . rtrim($gatewayip) . " ) ";
} else {
- log_error("Could not find {$g["tmp_path"]}/{$int}_router. Needed for dhcp gateway information");
+ log_error("Could not find {$g['tmp_path']}/{$int}_router. Needed for dhcp gateway information");
continue;
}
} else {
OpenPOWER on IntegriCloud