mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-25 17:13:11 +01:00
Correct handling of SWITCH column
- Handle exclusion - Correctly detect CONDITION_MATCH at compile time - Include condition match in the filter part of a NAT rule Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
12bfc14c5f
commit
40bc6df07a
@ -3745,10 +3745,12 @@ sub do_condition( $ ) {
|
|||||||
|
|
||||||
return '' if $condition eq '-';
|
return '' if $condition eq '-';
|
||||||
|
|
||||||
|
my $invert = $condition =~ s/^!// ? '! ' : '';
|
||||||
|
|
||||||
require_capability 'CONDITION_MATCH', 'A non-empty SWITCH column', 's';
|
require_capability 'CONDITION_MATCH', 'A non-empty SWITCH column', 's';
|
||||||
fatal_error "Invalid switch name ($condition)" unless $condition =~ /^[a-zA-Z][-\w]*$/;
|
fatal_error "Invalid switch name ($condition)" unless $condition =~ /^[a-zA-Z][-\w]*$/;
|
||||||
|
|
||||||
"-m condition --condition $condition "
|
"-m condition ${invert}--condition $condition "
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2674,7 +2674,7 @@ sub Account_Target() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub Condition_Match() {
|
sub Condition_Match() {
|
||||||
qt1( "$iptables -m condition --condition foo" );
|
qt1( "$iptables -A $sillyname -m condition --condition foo" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub Audit_Target() {
|
sub Audit_Target() {
|
||||||
|
@ -2087,8 +2087,10 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$ $) {
|
|||||||
$rule = join( '',
|
$rule = join( '',
|
||||||
do_proto( $proto, $ports, $sports ),
|
do_proto( $proto, $ports, $sports ),
|
||||||
do_ratelimit( $ratelimit, 'ACCEPT' ),
|
do_ratelimit( $ratelimit, 'ACCEPT' ),
|
||||||
do_user $user ,
|
do_user $user,
|
||||||
do_test( $mark , $globals{TC_MASK} ) );
|
do_test( $mark , $globals{TC_MASK} ),
|
||||||
|
do_condition( $condition )
|
||||||
|
);
|
||||||
$loglevel = '';
|
$loglevel = '';
|
||||||
$dest = $server;
|
$dest = $server;
|
||||||
$action = 'ACCEPT';
|
$action = 'ACCEPT';
|
||||||
|
Loading…
Reference in New Issue
Block a user