More cleanup from the cheif Alchemist

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@2627 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2005-09-03 00:48:37 +00:00
parent d6cf893327
commit b663bdf559

View File

@ -492,23 +492,24 @@ flushmangle() # $1 = name of chain
# #
determine_zones() determine_zones()
{ {
local zone parent parents rest new_zone_file= local zone parent parents rest new_zone_file= r
merge_zone() merge_zone()
{ {
local z zones="$ZONES" merged= local z zones="$ZONES" merged=
ZONES= if [ -n "$parents" ]; then
ZONES=
for z in $zones; do for z in $zones; do
if [ -z "$merged" ] && list_search $z $parents; then if [ -z "$merged" ] && list_search $z $parents; then
ZONES="$ZONES $zone" ZONES="$ZONES $zone"
merged=Yes merged=Yes
fi fi
ZONES="$ZONES $z" ZONES="$ZONES $z"
done done
else
[ -n "$merged" ] || ZONES="$ZONES $zone" ZONES="$ZONES $zone"
fi
} }
strip_file zones strip_file zones
@ -564,14 +565,17 @@ determine_zones()
firewall) firewall)
list_search $zone $ZONES && startup_error "Zone $zone is defined more than once" list_search $zone $ZONES && startup_error "Zone $zone is defined more than once"
[ -n "$parents" ] && startup_error "The firewall zone may not be nested" [ -n "$parents" ] && startup_error "The firewall zone may not be nested"
[ -n "$rest" ] && startup_error "OPTIONS not allowed in a firewall zone" for r in $rest; do
[ "x$r" = x- ] || startup_error "OPTIONS not allowed on the firewall zone"
done
FW=$zone FW=$zone
;; ;;
*) *)
startup_error "Invalid Zone Type: $zone" startup_error "Invalid Zone Type: $type"
;; ;;
esac esac
else else
list_search $zone $ZONES $FW && startup_error "Zone $zone is defined more than once"
ZONES="$ZONES $zone" ZONES="$ZONES $zone"
fi fi
done < $TMP_DIR/zones done < $TMP_DIR/zones