From 28528770d4515eb602c1f6da74c486e53d3fb91b Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 21 May 2007 23:09:40 +0000 Subject: [PATCH] Fix missing action in macro or action git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6434 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Actions.pm | 2 ++ Shorewall-perl/Shorewall/Rules.pm | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Actions.pm b/Shorewall-perl/Shorewall/Actions.pm index 85f737f54..5c8174550 100644 --- a/Shorewall-perl/Shorewall/Actions.pm +++ b/Shorewall-perl/Shorewall/Actions.pm @@ -323,6 +323,8 @@ sub process_action1 ( $$ ) { fatal_error "Parameter value not allowed in action files ($param)" if $paramtype & NATRULE; } + fatal_error "Invalid or missing ACTION ( $wholetarget )" unless defined $target; + if ( find_macro $target ) { process_macro1( $action, $macros{$target} ); } else { diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index 2dd54b2d5..b2033aef5 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -808,7 +808,10 @@ sub process_macro ( $$$$$$$$$$$$ ) { $mtarget = substitute_param $param, $mtarget; } - my $action = isolate_basic_target $mtarget; + my $action = isolate_basic_target $mtarget; + + fatal_error "Invalid or missing ACTION ( $mtarget )" unless defined $action; + my $actiontype = $targets{$action} || find_macro( $action ); fatal_error "Invalid Action ($mtarget) in macro" unless $actiontype & ( ACTION + STANDARD + NATRULE + MACRO );