forked from extern/shorewall_code
Allow a parameter to INLINE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
38f3ae0934
commit
b33bdeaa02
@ -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 );
|
||||
|
@ -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 };
|
||||
|
Loading…
Reference in New Issue
Block a user