mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Make the operation of saving old rule nearby the writing operation to be logical to spot
This commit is contained in:
parent
53ce7798fa
commit
48085d0cc8
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user