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

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

View File

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

View File

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