diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index b652f8465..a4e90b216 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -207,7 +207,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script Exporter::export_ok_tags('internal'); -our $VERSION = '4.5_12'; +our $VERSION = 'MODULEVERSION'; # # describe the current command, it's present progressive, and it's completion. @@ -1955,7 +1955,7 @@ sub split_line1( $$;$$ ) { $pairs =~ s/^\s*//; $pairs =~ s/\s*$//; - if ( $first eq 'INLINE') { + if ( $first =~ /^INLINE(?:\(.*\))?$/) { $inline_matches = $pairs; } else { my @pairs = split( /,?\s+/, $pairs ); diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 2e8d433b4..79c67e5fa 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -2089,6 +2089,27 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$ ) { $param = '' unless defined $param; + if ( $basictarget eq 'INLINE' ) { + my $inline_matches = get_inline_matches; + + if ( $inline_matches =~ /^(.*\s+)-j\s+(.+)$/ ) { + $matches .= $1; + $action = $2; + fatal_error "INLINE may not have a parameter when '-j' is specified in the free-form area" if $param ne ''; + } else { + $matches .= "$inline_matches "; + + if ( $param eq '' ) { + $action = ''; + } else { + ( $action, $loglevel ) = split_action $param; + ( $basictarget, $param ) = get_target_param $action; + $param = '' unless defined $param; + } + } + + $rule = $matches; + } # # Determine the validity of the action # @@ -2238,20 +2259,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$ ) { fatal_error "HELPER requires require that the helper be specified in the HELPER column" if $helper eq '-'; fatal_error "HELPER rules may only appear in the NEW section" unless $section == NEW_SECTION; $action = ''; } , - - INLINE => sub { - my $inline_matches = get_inline_matches; - - if ( $inline_matches =~ /^(.*\s+)-j\s+(.+)$/ ) { - $matches .= $1; - $action = $2; - } else { - $matches .= "$inline_matches "; - $action = ''; - } - - $rule = $matches; - } , ); my $function = $functions{ $bt };