Backport fixes; allow bang in accounting rules

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1336 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2004-05-18 13:56:35 +00:00
parent 45c76e36a7
commit a546817aa6
3 changed files with 10 additions and 6 deletions

View File

@ -5,4 +5,6 @@ Changes since 2.0.2
2) Restore file now loads kernel modules. 2) Restore file now loads kernel modules.
3) Minor tweaks to the restore mechanism. 3) Minor tweaks to the restore mechanism.
4) Allow "!" in accounting rules.

View File

@ -2238,8 +2238,8 @@ process_accounting_rule() {
ensurechain1 $chain ensurechain1 $chain
if iptables -A $chain $rule ; then if iptables -A $chain $(fix_bang $rule) ; then
[ "x$rule2" != x ] && run_iptables -A $jumpchain $rule2 [ -n "$rule2" ] && run_iptables2 -A $jumpchain $rule2
progress_message " Accounting rule" $action $chain $source $dest $proto $port $sport Added progress_message " Accounting rule" $action $chain $source $dest $proto $port $sport Added
else else
accounting_error accounting_error
@ -2730,7 +2730,7 @@ process_actions1() {
case $temp in case $temp in
ACCEPT|REJECT|DROP) ACCEPT|REJECT|DROP)
eval ${temp}_common=$xaction eval ${temp}_common=$xaction
if ! list_search $xaction $USEDACTIONS; then if [ -n "$xaction" ] && ! list_search $xaction $USEDACTIONS; then
USEDACTIONS="$USEDACTIONS $xaction" USEDACTIONS="$USEDACTIONS $xaction"
[ $COMMAND = check ] || createactionchain $xaction [ $COMMAND = check ] || createactionchain $xaction
fi fi
@ -5415,6 +5415,8 @@ define_firewall() # $1 = Command (Start or Restart)
verify_os_version verify_os_version
verify_ip verify_ip
[ -d /var/lib/shorewall ] || mkdir -p /var/lib/shorewall
echo '#bin/sh' > /var/lib/shorewall/restore-$$ echo '#bin/sh' > /var/lib/shorewall/restore-$$
save_command "# Restore base file generated $(date)" save_command "# Restore base file generated $(date)"
save_command ". /usr/share/shorewall/functions" save_command ". /usr/share/shorewall/functions"
@ -5952,7 +5954,7 @@ do_initialize() {
determine_capabilities determine_capabilities
[ -z "${STATEDIR}" ] && STATEDIR=/var/state/shorewall [ -z "${STATEDIR}" ] && STATEDIR=/var/state/shorewall
[ -d $STATEDIR ] || mkdir -p $STATEDIR [ -d $STATEDIR ] || mkdir -p $STATEDIR
[ -z "$FW" ] && FW=fw [ -z "$FW" ] && FW=fw

View File

@ -17,4 +17,4 @@ None.
New Features: New Features:
None. 1) "!" is now allowed in accounting rules.