diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 7b0005302..381199ba3 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1140,6 +1140,32 @@ sub warning_message $| = 0; #Re-allow output buffering } +# +# Q[uie]t version of system(). Returns true for success +# +sub qt( $ ) { + if ( $debug ) { + print "SYS----> @_\n"; + system( "@_ 2>&1 < /dev/null" ) == 0; + } else { + system( "@_ > /dev/null 2>&1 < /dev/null" ) == 0; + } +} + +sub qt0( $ ) { + if ( $debug ) { + print "SYS----> @_\n"; + system( "@_ 2>&1 < /dev/null" ); + } else { + system( "@_ > /dev/null 2>&1 < /dev/null" ); + } +} + +sub qt1( $ ) { + 1 while qt0( "@_" ) == 4; + $? == 0; +} + # # Delete the test chains # @@ -3568,23 +3594,6 @@ sub load_kernel_modules( ) { } } -# -# Q[uie]t version of system(). Returns true for success -# -sub qt( $ ) { - if ( $debug ) { - print "SYS----> @_\n"; - system( "@_ 2>&1" ) == 0; - } else { - system( "@_ > /dev/null 2>&1 < /dev/null" ) == 0; - } -} - -sub qt1( $ ) { - 1 while qt( "@_" ) == 4; - $? == 0; -} - # # Get the current kernel version # @@ -4356,7 +4365,7 @@ sub determine_capabilities() { $capabilities{MASQUERADE_TGT} = detect_capability( 'MASQUERADE_TGT' ); $capabilities{UDPLITEREDIRECT} = detect_capability( 'UDPLITEREDIRECT' ); $capabilities{NEW_TOS_MATCH} = detect_capability( 'NEW_TOS_MATCH' ); - + unless ( have_capability 'CT_TARGET' ) { $capabilities{HELPER_MATCH} = detect_capability 'HELPER_MATCH'; } diff --git a/Shorewall/Perl/Shorewall/Zones.pm b/Shorewall/Perl/Shorewall/Zones.pm index c755101c9..9b19eb7c4 100644 --- a/Shorewall/Perl/Shorewall/Zones.pm +++ b/Shorewall/Perl/Shorewall/Zones.pm @@ -965,7 +965,7 @@ sub local_zones() { # Determine if the passed physical device is a bridge # sub is_a_bridge( $ ) { - which 'brctl' && qt( "brctl show | tail -n+2 | grep -q '^$_[0]\[\[:space:\]\]'" ); + which 'brctl' && system( "brctl show < /dev/null | tail -n+2 | grep -q '^$_[0]\[\[:space:\]\]' > /dev/null" ) == 0; } #