summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-09-04 08:18:51 +0000
committerErmal <eri@pfsense.org>2013-09-04 08:18:51 +0000
commitdc8b4c4ec62837814c3ae07eda7813cdc76ef369 (patch)
tree29661dbaa2197521f524f485ecea5afb5fe17dc1 /etc
parentb214bf3a05afc37c8ce42ec802e55b1f793b6ceb (diff)
downloadpfsense-dc8b4c4ec62837814c3ae07eda7813cdc76ef369.zip
pfsense-dc8b4c4ec62837814c3ae07eda7813cdc76ef369.tar.gz
Make the operation of saving old rule nearby the writing operation to be logical to spot
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 4419d93..8139a00 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -239,10 +239,6 @@ function filter_configure_sync($delete_states_if_needed = true) {
return;
}
- // Copy rules.debug to rules.debug.old
- if(file_exists("{$g['tmp_path']}/rules.debug"))
- @copy("{$g['tmp_path']}/rules.debug", "{$g['tmp_path']}/rules.debug.old");
-
$limitrules = "";
/* Define the maximum number of tables the system can handle (should be at least aliases*2+some spare) */
$maxtables = is_numeric($config['system']['maximumtables']) ? $config['system']['maximumtables'] : "3000";
@@ -299,6 +295,10 @@ function filter_configure_sync($delete_states_if_needed = true) {
unset($aliases, $gateways, $altq_queues, $natrules, $pfrules);
+ // Copy rules.debug to rules.debug.old
+ if(file_exists("{$g['tmp_path']}/rules.debug"))
+ @copy("{$g['tmp_path']}/rules.debug", "{$g['tmp_path']}/rules.debug.old");
+
if (!@file_put_contents("{$g['tmp_path']}/rules.debug", $rules, LOCK_EX)) {
log_error("WARNING: Could not write new rules!");
unlock($filterlck);
OpenPOWER on IntegriCloud