From 9d512c2514019c00daf53a51de47b9e910927dc5 Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 16 Jun 2007 01:40:07 +0000 Subject: [PATCH] Fix mutex problems git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6558 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-common/shorewall | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Shorewall-common/shorewall b/Shorewall-common/shorewall index e146c2071..abf8ff955 100755 --- a/Shorewall-common/shorewall +++ b/Shorewall-common/shorewall @@ -859,7 +859,7 @@ safe_commands() { [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" - mutex_on + [ "$nolock" ] || mutex_on if shorewall_is_started; then running=Yes @@ -886,7 +886,7 @@ safe_commands() { if ! compiler run $debugging nolock compile ${VARDIR}/.$command; then status=$? - mutex_off + [ "$nolock" ] || mutex_off exit $status fi @@ -916,14 +916,15 @@ safe_commands() { ${VARDIR}/.$command clear fi - mutex_off + [ "$nolock" ] || mutex_off + echo "New configuration has been rejected and the old one restored" exit 2 fi fi - mutex_off + [ "$nolock" ] || mutex_off } # @@ -1006,7 +1007,7 @@ try_command() { [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" - mutex_on + [ "$nolock" ] || mutex_on if shorewall_is_started; then running=Yes @@ -1026,7 +1027,7 @@ try_command() { if ! compiler run $debugging $nolock compile ${VARDIR}/.$command; then status=$? - mutex_off + [ "$nolock" ] || mutex_off exit $status fi @@ -1053,7 +1054,7 @@ try_command() { fi fi - mutex_off + [ "$nolock" ] || mutex_off return 0 } @@ -1584,9 +1585,9 @@ case "$COMMAND" in [ -n "$debugging" ] && set -x [ $# -eq 1 ] && usage 1 if shorewall_is_started ; then - mutex_on + [ "$nolock" ] || mutex_on block DROP Dropped $* - mutex_off + [ "$nolock" ] || mutex_off else fatal_error "Shorewall is not started" fi @@ -1596,9 +1597,9 @@ case "$COMMAND" in [ -n "$debugging" ] && set -x [ $# -eq 1 ] && usage 1 if shorewall_is_started ; then - mutex_on + [ "$nolock" ] || mutex_on block logdrop Dropped $* - mutex_off + [ "$nolock" ] || mutex_off else fatal_error "Shorewall is not started" fi @@ -1608,9 +1609,9 @@ case "$COMMAND" in [ -n "$debugging" ] && set -x [ $# -eq 1 ] && usage 1 if shorewall_is_started ; then - mutex_on + [ "$nolock" ] || mutex_on block $COMMAND Rejected $* - mutex_off + [ "$nolock" ] || mutex_off else fatal_error "Shorewall is not started" fi @@ -1636,7 +1637,6 @@ case "$COMMAND" in esac RESTOREPATH=${VARDIR}/$RESTOREFILE - mutex_off [ "$nolock" ] || mutex_on