mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-09 19:26:50 +02:00
Update modules to use passed() for parameter testing
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
eb9dd3e485
commit
65ce6ed226
@ -2596,7 +2596,8 @@ sub evaluate_expression( $$$$ ) {
|
|||||||
$val = eval qq(package Shorewall::User;
|
$val = eval qq(package Shorewall::User;
|
||||||
use strict;
|
use strict;
|
||||||
use Shorewall::Config \(qw/supplied/\);
|
use Shorewall::Config \(qw/supplied/\);
|
||||||
# line $linenumber "$filename"\n$expression);
|
# line $linenumber "$filename"
|
||||||
|
$expression);
|
||||||
|
|
||||||
unless ( $val ) {
|
unless ( $val ) {
|
||||||
directive_error( "Couldn't parse expression ($expression): $@" , $filename, $linenumber ) if $@;
|
directive_error( "Couldn't parse expression ($expression): $@" , $filename, $linenumber ) if $@;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
?if @1 ne '' && @1 ne '-'
|
?if passed(@1)
|
||||||
?if @1 eq 'audit'
|
?if @1 eq 'audit'
|
||||||
DEFAULTS -,-,A_DROP,A_ACCEPT,A_DROP
|
DEFAULTS -,-,A_DROP,A_ACCEPT,A_DROP
|
||||||
?else
|
?else
|
||||||
@ -47,7 +47,7 @@ COUNT
|
|||||||
#
|
#
|
||||||
# Special Handling for Auth
|
# Special Handling for Auth
|
||||||
#
|
#
|
||||||
?if @2 ne '-'
|
?if passed(@2)
|
||||||
Auth(@2)
|
Auth(@2)
|
||||||
?endif
|
?endif
|
||||||
#
|
#
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
DEFAULTS 2,0
|
DEFAULTS 2,0
|
||||||
|
|
||||||
?if @1 !~ /^\d+/ || ! @1 || @1 > 1024
|
?if @1 !~ /^\d+/ || ! @1 || @1 > 1024
|
||||||
?error Invalid value for Bricks (@1)
|
?error Invalid value for Bricks (@1)
|
||||||
?elsif @2 !~ /^[01]$/
|
?elsif @2 !~ /^[01]$/
|
||||||
?error Invalid value for IB (@2)
|
?error Invalid value for IB (@2)
|
||||||
?endif
|
?endif
|
||||||
|
|
||||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
?if @1 ne '' && @1 ne '-'
|
?if passed(@1)
|
||||||
?if @1 eq 'audit'
|
?if @1 eq 'audit'
|
||||||
DEFAULTS -,-,A_REJECT,A_ACCEPT,A_DROP
|
DEFAULTS -,-,A_REJECT,A_ACCEPT,A_DROP
|
||||||
?else
|
?else
|
||||||
@ -46,7 +46,7 @@ COUNT
|
|||||||
#
|
#
|
||||||
# Special handling for Auth
|
# Special handling for Auth
|
||||||
#
|
#
|
||||||
?if @2 ne '-'
|
?if passed(@2)
|
||||||
Auth(@2)
|
Auth(@2)
|
||||||
?endif
|
?endif
|
||||||
#
|
#
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
DEFAULTS -
|
DEFAULTS -
|
||||||
|
|
||||||
?if @1 ne '' && @1 ne '-'
|
?if passed(@1)
|
||||||
?if @1 eq 'audit'
|
?if @1 eq 'audit'
|
||||||
?set tcpflags_action 'A_DROP'
|
?set tcpflags_action 'A_DROP'
|
||||||
?else
|
?else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user