From 2c10d4b8f94076d4caad45f4d6cbd4287a6f59c1 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 1 Oct 2010 13:56:44 -0700 Subject: [PATCH] Clamp VERBOSITY to valid range Signed-off-by: Tom Eastep --- Shorewall-lite/shorewall-lite | 6 ++++++ Shorewall6-lite/shorewall6-lite | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Shorewall-lite/shorewall-lite b/Shorewall-lite/shorewall-lite index 63f31479c..395554468 100755 --- a/Shorewall-lite/shorewall-lite +++ b/Shorewall-lite/shorewall-lite @@ -145,6 +145,12 @@ get_config() { [ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY)) + if [ $VERBOSITY -lt -1 ]; then + VERBOSITY=-1 + elif [ $VERBOSITY -gt 2 ]; then + VERBOSITY=2 + fi + g_hostname=$(hostname 2> /dev/null) IP=$(mywhich ip 2> /dev/null) diff --git a/Shorewall6-lite/shorewall6-lite b/Shorewall6-lite/shorewall6-lite index ba7ca2da9..541cce77b 100755 --- a/Shorewall6-lite/shorewall6-lite +++ b/Shorewall6-lite/shorewall6-lite @@ -145,6 +145,12 @@ get_config() { [ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY)) + if [ $VERBOSITY -lt -1 ]; then + VERBOSITY=-1 + elif [ $VERBOSITY -gt 2 ]; then + VERBOSITY=2 + fi + g_hostname=$(hostname 2> /dev/null) IP=$(mywhich ip 2> /dev/null)