mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 01:37:59 +02:00
Permit when firewall stopped when using an ipset for dynamic BL
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
2c3f121835
commit
196a56ea3c
@ -2575,15 +2575,21 @@ hits_command() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Issue an error message and terminate if the firewall isn't started
|
||||||
|
#
|
||||||
|
require_started() {
|
||||||
|
if ! product_is_started; then
|
||||||
|
error_message "ERROR: $g_product is not started"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# 'allow' command executor
|
# 'allow' command executor
|
||||||
#
|
#
|
||||||
allow_command() {
|
allow_command() {
|
||||||
|
|
||||||
[ -n "$g_debugging" ] && set -x
|
|
||||||
[ $# -eq 1 ] && missing_argument
|
|
||||||
|
|
||||||
if product_is_started ; then
|
|
||||||
local allowed
|
local allowed
|
||||||
local which
|
local which
|
||||||
which='-s'
|
which='-s'
|
||||||
@ -2591,8 +2597,10 @@ allow_command() {
|
|||||||
range='--src-range'
|
range='--src-range'
|
||||||
local dynexists
|
local dynexists
|
||||||
|
|
||||||
if [ -n "$g_blacklistipset" ]; then
|
[ -n "$g_debugging" ] && set -x
|
||||||
|
[ $# -eq 1 ] && missing_argument
|
||||||
|
|
||||||
|
if [ -n "$g_blacklistipset" ]; then
|
||||||
case ${IPSET:=ipset} in
|
case ${IPSET:=ipset} in
|
||||||
*/*)
|
*/*)
|
||||||
if [ ! -x "$IPSET" ]; then
|
if [ ! -x "$IPSET" ]; then
|
||||||
@ -2609,6 +2617,7 @@ allow_command() {
|
|||||||
if chain_exists dynamic; then
|
if chain_exists dynamic; then
|
||||||
dynexists=Yes
|
dynexists=Yes
|
||||||
elif [ -z "$g_blacklistipset" ]; then
|
elif [ -z "$g_blacklistipset" ]; then
|
||||||
|
require_started
|
||||||
fatal_error "Dynamic blacklisting is not enabled in the current $g_product configuration"
|
fatal_error "Dynamic blacklisting is not enabled in the current $g_product configuration"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -2674,10 +2683,6 @@ allow_command() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$g_nolock" ] || mutex_off
|
[ -n "$g_nolock" ] || mutex_off
|
||||||
else
|
|
||||||
error_message "ERROR: $g_product is not started"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user