From 8e5f67797a701f96a4fd5c0086513630f6572dd9 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 9 Jan 2019 14:24:09 -0800 Subject: [PATCH] Allow INLINE() in the accounting file to accept '+' in inline matches Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Accounting.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Accounting.pm b/Shorewall/Perl/Shorewall/Accounting.pm index 3c245dd14..5f7cb77eb 100644 --- a/Shorewall/Perl/Shorewall/Accounting.pm +++ b/Shorewall/Perl/Shorewall/Accounting.pm @@ -3,7 +3,7 @@ # # This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt] # -# (c) 2007-2017 - Tom Eastep (teastep@shorewall.net) +# (c) 2007-2019 - Tom Eastep (teastep@shorewall.net) # # Complete documentation is available at http://shorewall.net # @@ -201,6 +201,13 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) { my $prerule = ''; my $rule2 = 0; my $jump = 0; + my $raw_matches = get_inline_matches(1); + + if ( $raw_matches =~ s/^\s*+// ) { + $prerule = $raw_matches; + } else { + $rule .= $raw_matches; + } unless ( $action eq 'COUNT' ) { if ( $action eq 'DONE' ) { @@ -242,9 +249,7 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) { $rule .= do_nfacct( $_ ); } } - } elsif ( $action eq 'INLINE' ) { - $rule .= get_inline_matches(1); - } else { + } elsif ( $action ne 'INLINE' ) { ( $action, my $cmd ) = split /:/, $action; if ( $cmd ) {