From 67ba788889da15122a171d61ed417d3ef8958100 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 13 May 2007 17:00:19 +0000 Subject: [PATCH] Validate macro params in action files; don't complain about RSH_/RCP_COMMAND in shorewall.conf git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6338 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Actions.pm | 8 +++++++- Shorewall-perl/Shorewall/Config.pm | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Actions.pm b/Shorewall-perl/Shorewall/Actions.pm index 5aa39365d..d59fed596 100644 --- a/Shorewall-perl/Shorewall/Actions.pm +++ b/Shorewall-perl/Shorewall/Actions.pm @@ -315,7 +315,13 @@ sub process_action1 ( $$ ) { } elsif ( $target eq 'COMMENT' ) { fatal_error "Invalid TARGET ($wholetarget)" unless $wholetarget eq $target; } else { - $target =~ s!/.*$!!; + ( $target, my $param ) = split '/', $target; + + if ( defined $param ) { + my $paramtype = $targets{$param} || 0; + + fatal_error "Parameter value not allowed in action files ($param)" if $paramtype & NATRULE; + } if ( find_macro $target ) { process_macro1( $action, $macros{$target} ); diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index d5ad06264..92e0fa92d 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -122,6 +122,11 @@ our %config = ACCEPT_DEFAULT => undef, QUEUE_DEFAULT => undef, # + # RSH/RCP Commands + # + RSH_COMMAND => undef, + RCP_COMMAND => undef, + # # Firewall Options # BRIDGING => undef,