From 5fcdfd779cd38c1c9e2209247d5112c090d51fc8 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 9 Nov 2012 08:54:54 -0800 Subject: [PATCH] Don't default IPSET to 'ipset'. Signed-off-by: Tom Eastep --- Shorewall-core/lib.cli | 25 ++----------------------- Shorewall-core/lib.common | 2 +- Shorewall/Perl/Shorewall/Config.pm | 2 ++ Shorewall/lib.cli-std | 8 +++++++- 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 247fd1b17..79b36cc88 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -525,7 +525,7 @@ show_routing() { determine_ipset_version() { local setname - if [ $IPSET = ipset ]; then + if [ -z "$IPSET" -o $IPSET = ipset ]; then IPSET=$(mywhich ipset) [ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located" fi @@ -2956,27 +2956,6 @@ get_config() { fi fi - if [ -n "$IPSET" ]; then - case "$IPSET" in - */*) - if [ ! -x "$IPSET" ] ; then - echo " ERROR: The program specified in IPSET ($IPSET) does not exist or is not executable" >&2 - exit 2 - fi - ;; - *) - prog="$(mywhich $IPSET 2> /dev/null)" - if [ -z "$prog" ] ; then - echo " ERROR: Can't find $IPSET executable" >&2 - exit 2 - fi - IPSET=$prog - ;; - esac - else - IPSET='ipset' - fi - [ -n "$RESTOREFILE" ] || RESTOREFILE=restore validate_restorefile RESTOREFILE @@ -3017,7 +2996,7 @@ get_config() { ;; esac else - IPSET='ipset' + IPSET='' fi TC=tc diff --git a/Shorewall-core/lib.common b/Shorewall-core/lib.common index d02fdc29f..fdc384b65 100644 --- a/Shorewall-core/lib.common +++ b/Shorewall-core/lib.common @@ -84,7 +84,7 @@ get_script_version() { # $1 = script temp=$( $SHOREWALL_SHELL $1 version | tail -n 1 | sed 's/-.*//' ) - if [ $? -ne 0 ]; then + if [ -z "$temp" ]; then version=0 else ifs=$IFS diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index d0601ba4c..c7252f8a2 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -4564,6 +4564,8 @@ sub get_configuration( $$$ ) { default_yes_no 'AUTOHELPERS' , 'Yes'; default_yes_no 'RESTORE_ROUTEMARKS' , 'Yes'; + $config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset'; + if ( supplied $config{HELPERS} ) { my %helpers_temp = %helpers_enabled; diff --git a/Shorewall/lib.cli-std b/Shorewall/lib.cli-std index 956a6ce3c..6cdf316ba 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -136,6 +136,12 @@ get_config() { exit 2 fi ;; + ipset) + # + # Old config files had this as default + # + IPSET='' + ;; *) prog="$(mywhich $IPSET 2> /dev/null)" if [ -z "$prog" ] ; then @@ -146,7 +152,7 @@ get_config() { ;; esac else - IPSET='ipset' + IPSET='' fi if [ -n "$TC" ]; then