mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-23 16:13:18 +01:00
Add accounting-rule sanity check
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8422 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
4c4b58d9cc
commit
b1c5eefb6b
@ -144,8 +144,6 @@ sub process_accounting_rule( $$$$$$$$$ ) {
|
||||
|
||||
my $chainref = ensure_accounting_chain $chain;
|
||||
|
||||
check_chain( $chainref );
|
||||
|
||||
expand_rule
|
||||
$chainref ,
|
||||
$restriction ,
|
||||
@ -179,6 +177,8 @@ sub setup_accounting() {
|
||||
|
||||
first_entry "$doing $fn...";
|
||||
|
||||
my $nonEmpty = 0;
|
||||
|
||||
while ( read_a_line ) {
|
||||
|
||||
my ( $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark ) = split_line1 1, 9, 'Accounting File';
|
||||
@ -186,10 +186,13 @@ sub setup_accounting() {
|
||||
if ( $action eq 'COMMENT' ) {
|
||||
process_comment;
|
||||
} else {
|
||||
$nonEmpty = 1;
|
||||
process_accounting_rule $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark;
|
||||
}
|
||||
}
|
||||
|
||||
fatal_error "Accounring rules are isolated" if $nonEmpty && ! $filter_table->{accounting};
|
||||
|
||||
clear_comment;
|
||||
|
||||
if ( have_bridges ) {
|
||||
|
Loading…
Reference in New Issue
Block a user