Smarten up action.Drop and action.Reject WRT omitted parameters

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-06-22 15:45:14 -07:00
parent a5167dcd28
commit 000268f50c
2 changed files with 8 additions and 8 deletions

View File

@ -42,10 +42,10 @@ use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
if ( defined $p1 && $p1 eq 'audit' ) {
set_action_param( 2, 'A_REJECT') unless supplied $p2;
set_action_param( 3, 'A_DROP') unless supplied $p3;
set_action_param( 4, 'A_ACCEPT' ) unless supplied $p4;
set_action_param( 5, 'A_DROP' ) unless supplied $p5;
set_action_param( 2, 'A_REJECT') unless defined( $p2 ) && $p2 ne '-';
set_action_param( 3, 'A_DROP') unless defined( $p3 ) && $p3 ne '-';
set_action_param( 4, 'A_ACCEPT' ) unless defined( $p4 ) && $p4 ne '-';
set_action_param( 5, 'A_DROP' ) unless defined( $p5 ) && $p5 ne '-';
};
1;

View File

@ -38,10 +38,10 @@ use Shorewall::Config;
my ( $p1, $p2, $p3, $p4, $p5 ) = get_action_params( 5 );
if ( defined $p1 && $p1 eq 'audit' ) {
set_action_param( 2, 'A_REJECT') unless supplied $p2;
set_action_param( 3, 'A_REJECT') unless supplied $p3;
set_action_param( 4, 'A_ACCEPT' ) unless supplied $p5;
set_action_param( 5, 'A_DROP' ) unless supplied $p5;
set_action_param( 2, 'A_REJECT') unless defined( $p2 ) && $p2 ne '-';
set_action_param( 3, 'A_REJECT') unless defined( $p3 ) && $p3 ne '-';
set_action_param( 4, 'A_ACCEPT' ) unless defined( $p5 ) && $p4 ne '-';
set_action_param( 5, 'A_DROP' ) unless defined( $p5 ) && $p5 ne '-';
};
1;