From 61638c996ce1fd5d04ae8d25180a2e243e614624 Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 5 Jun 2007 22:13:58 +0000 Subject: [PATCH] Allow 'any' and 'all' in /etc/shorewall/accounting git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6467 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Accounting.pm | 8 ++++++++ Shorewall-perl/Shorewall/Config.pm | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Accounting.pm b/Shorewall-perl/Shorewall/Accounting.pm index b0692be84..501b859eb 100644 --- a/Shorewall-perl/Shorewall/Accounting.pm +++ b/Shorewall-perl/Shorewall/Accounting.pm @@ -27,6 +27,7 @@ package Shorewall::Accounting; require Exporter; use Shorewall::Common; use Shorewall::Config; +use Shorewall::IPAddrs; use Shorewall::Zones; use Shorewall::Chains; @@ -63,6 +64,10 @@ sub process_accounting_rule( $$$$$$$$$ ) { my $target = ''; + $proto = '' if $proto eq 'any'; + $ports = '' if $ports eq 'any' || $ports eq 'all'; + $sports = '' if $sports eq 'any' || $sports eq 'all'; + my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user ) . do_test ( $mark, 0xFF ); my $rule2 = 0; @@ -84,6 +89,9 @@ sub process_accounting_rule( $$$$$$$$$ ) { } } + $source = ALLIPv4 if $source eq 'any' || $source eq 'all'; + $dest = ALLIPv4 if $dest eq 'any' || $dest eq 'all'; + expand_rule $chainref , NO_RESTRICT , diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 87270c23e..1e385ef37 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -1157,7 +1157,7 @@ sub append_file( $ ) { my $user_exit = find_file $_[0]; my $result = 0; - unless ( $user_exit =~ /$globals{SHAREDIR}/ ) { + unless ( $user_exit =~ /^($globals{SHAREDIR})/ ) { if ( -f $user_exit ) { $result = 1; save_progress_message "Processing $user_exit ...";