Fix mutex problems

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6558 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-06-16 01:40:07 +00:00
parent d1cb2b1811
commit 9d512c2514

View File

@ -859,7 +859,7 @@ safe_commands() {
[ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled"
mutex_on [ "$nolock" ] || mutex_on
if shorewall_is_started; then if shorewall_is_started; then
running=Yes running=Yes
@ -886,7 +886,7 @@ safe_commands() {
if ! compiler run $debugging nolock compile ${VARDIR}/.$command; then if ! compiler run $debugging nolock compile ${VARDIR}/.$command; then
status=$? status=$?
mutex_off [ "$nolock" ] || mutex_off
exit $status exit $status
fi fi
@ -916,14 +916,15 @@ safe_commands() {
${VARDIR}/.$command clear ${VARDIR}/.$command clear
fi fi
mutex_off [ "$nolock" ] || mutex_off
echo "New configuration has been rejected and the old one restored" echo "New configuration has been rejected and the old one restored"
exit 2 exit 2
fi fi
fi fi
mutex_off [ "$nolock" ] || mutex_off
} }
# #
@ -1006,7 +1007,7 @@ try_command() {
[ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled"
mutex_on [ "$nolock" ] || mutex_on
if shorewall_is_started; then if shorewall_is_started; then
running=Yes running=Yes
@ -1026,7 +1027,7 @@ try_command() {
if ! compiler run $debugging $nolock compile ${VARDIR}/.$command; then if ! compiler run $debugging $nolock compile ${VARDIR}/.$command; then
status=$? status=$?
mutex_off [ "$nolock" ] || mutex_off
exit $status exit $status
fi fi
@ -1053,7 +1054,7 @@ try_command() {
fi fi
fi fi
mutex_off [ "$nolock" ] || mutex_off
return 0 return 0
} }
@ -1584,9 +1585,9 @@ case "$COMMAND" in
[ -n "$debugging" ] && set -x [ -n "$debugging" ] && set -x
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && usage 1
if shorewall_is_started ; then if shorewall_is_started ; then
mutex_on [ "$nolock" ] || mutex_on
block DROP Dropped $* block DROP Dropped $*
mutex_off [ "$nolock" ] || mutex_off
else else
fatal_error "Shorewall is not started" fatal_error "Shorewall is not started"
fi fi
@ -1596,9 +1597,9 @@ case "$COMMAND" in
[ -n "$debugging" ] && set -x [ -n "$debugging" ] && set -x
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && usage 1
if shorewall_is_started ; then if shorewall_is_started ; then
mutex_on [ "$nolock" ] || mutex_on
block logdrop Dropped $* block logdrop Dropped $*
mutex_off [ "$nolock" ] || mutex_off
else else
fatal_error "Shorewall is not started" fatal_error "Shorewall is not started"
fi fi
@ -1608,9 +1609,9 @@ case "$COMMAND" in
[ -n "$debugging" ] && set -x [ -n "$debugging" ] && set -x
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && usage 1
if shorewall_is_started ; then if shorewall_is_started ; then
mutex_on [ "$nolock" ] || mutex_on
block $COMMAND Rejected $* block $COMMAND Rejected $*
mutex_off [ "$nolock" ] || mutex_off
else else
fatal_error "Shorewall is not started" fatal_error "Shorewall is not started"
fi fi
@ -1636,7 +1637,6 @@ case "$COMMAND" in
esac esac
RESTOREPATH=${VARDIR}/$RESTOREFILE RESTOREPATH=${VARDIR}/$RESTOREFILE
mutex_off
[ "$nolock" ] || mutex_on [ "$nolock" ] || mutex_on