From 87dbf42bad456feb930212231d5dea38748f4a96 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)