mirror of
https://gitlab.com/shorewall/code.git
synced 2025-02-23 21:21:49 +01:00
Allow Extension Scripts for Accounting Chains
This commit is contained in:
parent
4f4925002a
commit
120aade417
@ -945,9 +945,23 @@ sub ensure_accounting_chain( $ )
|
|||||||
if ( $chainref ) {
|
if ( $chainref ) {
|
||||||
fatal_error "Non-accounting chain ($chain) used in accounting rule" unless $chainref->{accounting};
|
fatal_error "Non-accounting chain ($chain) used in accounting rule" unless $chainref->{accounting};
|
||||||
} else {
|
} else {
|
||||||
$chainref = new_chain 'filter' , $chain unless $chainref;
|
$chainref = new_chain 'filter' , $chain;
|
||||||
$chainref->{accounting} = 1;
|
$chainref->{accounting} = 1;
|
||||||
$chainref->{referenced} = 1;
|
$chainref->{referenced} = 1;
|
||||||
|
|
||||||
|
my $file = find_file $chain;
|
||||||
|
|
||||||
|
if ( -f $file ) {
|
||||||
|
progress_message "Processing $file...";
|
||||||
|
|
||||||
|
my ( $level, $tag ) = ( '', '' );
|
||||||
|
|
||||||
|
unless ( my $return = eval `cat $file` ) {
|
||||||
|
fatal_error "Couldn't parse $file: $@" if $@;
|
||||||
|
fatal_error "Couldn't do $file: $!" unless defined $return;
|
||||||
|
fatal_error "Couldn't run $file" unless $return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$chainref;
|
$chainref;
|
||||||
|
@ -26,6 +26,8 @@ Changes in Shorewall 4.4.2
|
|||||||
|
|
||||||
12) Change 'wait4ifup' so that it requires no PATH
|
12) Change 'wait4ifup' so that it requires no PATH
|
||||||
|
|
||||||
|
13) Allow extension scripts for accounting chains.
|
||||||
|
|
||||||
Changes in Shorewall 4.4.1
|
Changes in Shorewall 4.4.1
|
||||||
|
|
||||||
1) Deleted extra 'use ...IPAddrs.pm' from Nat.pm.
|
1) Deleted extra 'use ...IPAddrs.pm' from Nat.pm.
|
||||||
|
@ -246,6 +246,14 @@ None.
|
|||||||
/etc/shorewall/rules and must be empty in macros invoked from an
|
/etc/shorewall/rules and must be empty in macros invoked from an
|
||||||
action.
|
action.
|
||||||
|
|
||||||
|
3) Accounting chains may now have extension scripts. Simply place your
|
||||||
|
Perl script in the file /etc/shorewall/<chain> and when the
|
||||||
|
accounting chain named <chain> is created, your script will be
|
||||||
|
invoked.
|
||||||
|
|
||||||
|
As usual, the variable $chainref will contain a reference to the
|
||||||
|
chain's table entry.
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
N E W F E A T U R E S I N 4 . 4 . 0
|
N E W F E A T U R E S I N 4 . 4 . 0
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user