mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
A more elegant fix for empty blacklist file
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5174 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
8558d49676
commit
76e2eefc48
@ -1096,7 +1096,7 @@ compile_refresh_firewall()
|
|||||||
save_command progress_message2 \"Refreshing Black List...\"
|
save_command progress_message2 \"Refreshing Black List...\"
|
||||||
run_iptables -F blacklst
|
run_iptables -F blacklst
|
||||||
|
|
||||||
save_command load_blacklist
|
[ -s ${TMP_DIR}/blacklist ] && save_command load_blacklist
|
||||||
|
|
||||||
INDENT="$indent"
|
INDENT="$indent"
|
||||||
save_command "fi"
|
save_command "fi"
|
||||||
@ -3297,31 +3297,29 @@ process_blacklist()
|
|||||||
local disposition=$BLACKLIST_DISPOSITION
|
local disposition=$BLACKLIST_DISPOSITION
|
||||||
local f=$(find_file blacklist)
|
local f=$(find_file blacklist)
|
||||||
|
|
||||||
[ "$disposition" = REJECT ] && disposition=reject
|
if [ -s $TMP_DIR/blacklist ]; then
|
||||||
|
|
||||||
progress_message2 "Compiling $f..."
|
[ "$disposition" = REJECT ] && disposition=reject
|
||||||
|
|
||||||
cat >&3 << __EOF__
|
progress_message2 "Compiling $f..."
|
||||||
|
|
||||||
|
cat >&3 << __EOF__
|
||||||
#
|
#
|
||||||
# Load the blacklist
|
# Load the blacklist
|
||||||
#
|
#
|
||||||
load_blacklist()
|
load_blacklist()
|
||||||
{
|
{
|
||||||
__EOF__
|
__EOF__
|
||||||
INDENT=" "
|
INDENT=" "
|
||||||
|
|
||||||
if [ -s $TMP_DIR/blacklist ]; then
|
|
||||||
|
|
||||||
while read networks protocol ports; do
|
while read networks protocol ports; do
|
||||||
process_blacklist_rec
|
process_blacklist_rec
|
||||||
done < $TMP_DIR/blacklist
|
done < $TMP_DIR/blacklist
|
||||||
else
|
|
||||||
save_command true
|
|
||||||
fi
|
|
||||||
|
|
||||||
INDENT=
|
INDENT=
|
||||||
save_command "}"
|
save_command "}"
|
||||||
save_command
|
save_command
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user