From 000268f50c39d5a95ab8def318f8c2fb3e6c920f Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 22 Jun 2011 15:45:14 -0700 Subject: [PATCH] Smarten up action.Drop and action.Reject WRT omitted parameters Signed-off-by: Tom Eastep --- Shorewall/action.Drop | 8 ++++---- Shorewall/action.Reject | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Shorewall/action.Drop b/Shorewall/action.Drop index b67671d9d..477619fcf 100644 --- a/Shorewall/action.Drop +++ b/Shorewall/action.Drop @@ -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; diff --git a/Shorewall/action.Reject b/Shorewall/action.Reject index 9417565bb..f0f16896c 100644 --- a/Shorewall/action.Reject +++ b/Shorewall/action.Reject @@ -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;