From ef4ab62dd38d746047a13e51df13182c9206cf08 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 9 Nov 2016 07:47:19 -0800 Subject: [PATCH] Disable directive callbacks after file conversion. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Misc.pm | 4 ++++ Shorewall/Perl/Shorewall/Tc.pm | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Misc.pm b/Shorewall/Perl/Shorewall/Misc.pm index a186103c3..b2a8dd854 100644 --- a/Shorewall/Perl/Shorewall/Misc.pm +++ b/Shorewall/Perl/Shorewall/Misc.pm @@ -311,6 +311,8 @@ sub convert_blacklist() { } } + directive_callback(0); + if ( @rules ) { my $fn1 = find_writable_file( 'blrules' ); my $blrules; @@ -521,6 +523,8 @@ EOF push @allhosts, @hosts; } + directive_callback(0); + for my $host ( @allhosts ) { my ( $interface, $h, $seq ) = split /\|/, $host; my $rule = shift @rule; diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm index 82538d3db..a0549b373 100644 --- a/Shorewall/Perl/Shorewall/Tc.pm +++ b/Shorewall/Perl/Shorewall/Tc.pm @@ -2247,6 +2247,8 @@ sub convert_tos($$) { $have_tos = 1; } + directive_callback(0); + if ( $have_tos ) { progress_message2 "Converted $fn to $fn1"; if ( rename $fn, "$fn.bak" ) {