diff options
author | Ermal <eri@pfsense.org> | 2013-09-04 08:18:51 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-09-04 08:19:03 +0000 |
commit | 48085d0cc8b3a511c305d9aeb102723cb42579a9 (patch) | |
tree | 6d1d4a7f336e6e7f11d31de237208fef9c753e00 /etc | |
parent | 53ce7798fa386de90f6daeabf27c41a1e1f26583 (diff) | |
download | pfsense-48085d0cc8b3a511c305d9aeb102723cb42579a9.zip pfsense-48085d0cc8b3a511c305d9aeb102723cb42579a9.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.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index c12e6e9..ee5e3c7 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -213,10 +213,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"; @@ -273,6 +269,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); |