From 6c802d3353130ca611de0543854c8bbeb78c2343 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 9 Jul 2011 06:50:23 -0700 Subject: [PATCH] Tighten up source and dest checking in expand_rule() Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index a47ebdeea..ab563ff7c 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -3910,7 +3910,7 @@ sub expand_rule( $$$$$$$$$$;$ ) # # Isolate Source Interface, if any # - if ( $source ) { + if ( supplied $source ) { if ( $source eq '-' ) { $source = ''; } elsif ( $family == F_IPV4 ) { @@ -3945,7 +3945,7 @@ sub expand_rule( $$$$$$$$$$;$ ) # # Verify Interface, if any # - if ( $iiface ) { + if ( supplied $iiface ) { fatal_error "Unknown Interface ($iiface)" unless known_interface $iiface; if ( $restriction & POSTROUTE_RESTRICT ) { @@ -3981,7 +3981,7 @@ sub expand_rule( $$$$$$$$$$;$ ) # # Isolate Destination Interface, if any # - if ( $dest ) { + if ( supplied $dest ) { if ( $dest eq '-' ) { $dest = ''; } elsif ( ( $restriction & PREROUTE_RESTRICT ) && $dest =~ /^detect:(.*)$/ ) { @@ -4044,7 +4044,7 @@ sub expand_rule( $$$$$$$$$$;$ ) # # Verify Destination Interface, if any # - if ( $diface ) { + if ( supplied $diface ) { fatal_error "Unknown Interface ($diface)" unless known_interface $diface; if ( $restriction & PREROUTE_RESTRICT ) {