From 063e21e69faa342bcc6f3eef8e13fcc78b31f18c Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 20 Jun 2011 19:45:01 -0700 Subject: [PATCH] Allow an empty parameter list in an action (e.g., "Action()") Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 14e2c3c1c..3dc3918a3 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -178,7 +178,8 @@ sub get_target_param( $ ) { my ( $target, $param ) = split '/', $_[0]; unless ( defined $param ) { - ( $target, $param ) = ( $1, $2 ) if $target =~ /^(.*?)[(](.*)[)]$/; + $target =~ s/\(\)$//; + ( $target, $param ) = ( $1, $2 ) if $target =~ /^(.*?)[(](.+)[)]$/; } ( $target, $param ); @@ -332,7 +333,7 @@ sub process_a_policy() { if ( "\L$default" eq 'none' ) { $default = 'none'; } elsif ( $actions{$def} ) { - $default = supplied $param ? normalize_action( $def, 'none', $param ) : normalize_action_name $default; + $default = supplied $param ? normalize_action( $def, 'none', $param ) : normalize_action_name $def; use_policy_action( $default ); } else { fatal_error "Unknown Default Action ($default)";