forked from extern/shorewall_code
Implement undocumented dumpfilter extension file
This commit is contained in:
parent
f0ef27b3e5
commit
033d43b014
@ -3437,6 +3437,17 @@ sub generate_aux_config() {
|
||||
emit '}';
|
||||
}
|
||||
|
||||
my $fn = find_file 'dumpfilter';
|
||||
|
||||
if ( -f $fn ) {
|
||||
emit( '',
|
||||
'dump_filter() {' );
|
||||
push_indent;
|
||||
append_file( $fn,1 ) or emit 'cat -';
|
||||
pop_indent;
|
||||
emit '}';
|
||||
}
|
||||
|
||||
finalize_aux_config;
|
||||
}
|
||||
|
||||
|
@ -811,10 +811,40 @@ show_command() {
|
||||
esac
|
||||
}
|
||||
|
||||
#
|
||||
# Dump Filter - For Shorewall-lite, if there was a dumpfilter file at compile-time,
|
||||
# then the compiler generated another version of this function and
|
||||
# embedded it in the firewall.conf file. That version supersedes this
|
||||
# one.
|
||||
#
|
||||
dump_filter() {
|
||||
local filter
|
||||
local command
|
||||
local first
|
||||
|
||||
command=${SHOREWALL_SHELL}
|
||||
|
||||
filter=$(find_file dumpfilter)
|
||||
|
||||
if [ -f $filter ]; then
|
||||
first=$(head -n1 $filter)
|
||||
|
||||
case $first in
|
||||
\#!*)
|
||||
command=${first#\#!}
|
||||
;;
|
||||
esac
|
||||
|
||||
$command $filter
|
||||
else
|
||||
cat -
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Dump Command Executor
|
||||
#
|
||||
dump_command() {
|
||||
do_dump_command() {
|
||||
local finished
|
||||
finished=0
|
||||
|
||||
@ -1068,6 +1098,10 @@ read_yesno_with_timeout() {
|
||||
fi
|
||||
}
|
||||
|
||||
dump_command() {
|
||||
do_dump_command | dump_filter
|
||||
}
|
||||
|
||||
#
|
||||
# Print a heading with leading and trailing black lines
|
||||
#
|
||||
|
@ -686,10 +686,40 @@ show_command() {
|
||||
esac
|
||||
}
|
||||
|
||||
#
|
||||
# Dump Filter - For Shorewall-lite, if there was a dumpfilter file at compile-time,
|
||||
# then the compiler generated another version of this function and
|
||||
# embedded it in the firewall.conf file. That version supersedes this
|
||||
# one.
|
||||
#
|
||||
dump_filter() {
|
||||
local filter
|
||||
local command
|
||||
local first
|
||||
|
||||
command=${SHOREWALL_SHELL}
|
||||
|
||||
filter=$(find_file dumpfilter)
|
||||
|
||||
if [ -f $filter ]; then
|
||||
first=$(head -n1 $filter)
|
||||
|
||||
case $first in
|
||||
\#!*)
|
||||
command=${first#\#!}
|
||||
;;
|
||||
esac
|
||||
|
||||
$command $filter
|
||||
else
|
||||
cat -
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Dump Command Executor
|
||||
#
|
||||
dump_command() {
|
||||
do_dump_command() {
|
||||
local finished
|
||||
finished=0
|
||||
|
||||
@ -833,6 +863,10 @@ dump_command() {
|
||||
fi
|
||||
}
|
||||
|
||||
dump_command() {
|
||||
do_dump_command | dump_filter
|
||||
}
|
||||
|
||||
#
|
||||
# Restore Comand Executor
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user