From 494956938319cfc7ced645c396ba3728fa8156b1 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 2 Dec 2016 09:32:00 -0800 Subject: [PATCH 1/2] Correct 'restore' exit status Signed-off-by: Tom Eastep --- Shorewall-core/lib.cli | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 83d895753..b0b220dfa 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -1809,6 +1809,7 @@ dump_command() { restore_command() { local finished finished=0 + local result while [ $finished -eq 0 -a $# -gt 0 ]; do option=$1 @@ -1873,8 +1874,11 @@ restore_command() { progress_message3 "Restoring $g_product..." run_it $g_restorepath restore && progress_message3 "$g_product restored from ${VARDIR}/$RESTOREFILE" + result=$? [ -n "$g_nolock" ] || mutex_off + + exit $result else echo "File $g_restorepath: file not found" [ -n "$g_nolock" ] || mutex_off From f537e3e15cb9454e5113a22f531506dcff4f7b37 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 2 Dec 2016 14:47:03 -0800 Subject: [PATCH 2/2] Fix optimization bug in merge_rules() - Reset the simple member if a unique option is merged Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 33b4aaad5..797bd11d5 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1218,6 +1218,7 @@ sub merge_rules( $$$ ) { if ( exists $fromref->{$option} ) { push( @{$toref->{matches}}, $option ) unless exists $toref->{$option}; $toref->{$option} = $fromref->{$option}; + $toref->{simple} = 0; } }