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
This commit is contained in:
teastep 2007-05-13 17:00:19 +00:00
parent 3a5b81082b
commit 67ba788889
2 changed files with 12 additions and 1 deletions

View File

@ -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} );

View File

@ -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,