Project

General

Profile

« Previous | Next » 

Revision dc8b4c4e

Added by Ermal LUÇI almost 12 years ago

Make the operation of saving old rule nearby the writing operation to be logical to spot

View differences:

etc/inc/filter.inc
239 239
		return;
240 240
	}
241 241

  
242
	// Copy rules.debug to rules.debug.old
243
	if(file_exists("{$g['tmp_path']}/rules.debug"))
244
		@copy("{$g['tmp_path']}/rules.debug", "{$g['tmp_path']}/rules.debug.old");
245

  
246 242
	$limitrules = "";
247 243
	/* Define the maximum number of tables the system can handle (should be at least aliases*2+some spare) */
248 244
	$maxtables = is_numeric($config['system']['maximumtables']) ? $config['system']['maximumtables'] : "3000";
......
299 295

  
300 296
	unset($aliases, $gateways, $altq_queues, $natrules, $pfrules);
301 297

  
298
	// Copy rules.debug to rules.debug.old
299
	if(file_exists("{$g['tmp_path']}/rules.debug"))
300
		@copy("{$g['tmp_path']}/rules.debug", "{$g['tmp_path']}/rules.debug.old");
301

  
302 302
	if (!@file_put_contents("{$g['tmp_path']}/rules.debug", $rules, LOCK_EX)) {
303 303
		log_error("WARNING: Could not write new rules!");
304 304
		unlock($filterlck);

Also available in: Unified diff