mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-10 07:38:12 +01:00
Fix 'findgw'
This commit is contained in:
parent
355a515b1b
commit
9dbafc59d0
@ -101,7 +101,7 @@ EOF
|
|||||||
|
|
||||||
copy1 $lib, emit "\n" if -f $lib;
|
copy1 $lib, emit "\n" if -f $lib;
|
||||||
|
|
||||||
for my $exit qw/init isusable start tcclear started stop stopped clear refresh refreshed restored findgw/ {
|
for my $exit qw/init start tcclear started stop stopped clear refresh refreshed restored/ {
|
||||||
emit "\nrun_${exit}_exit() {";
|
emit "\nrun_${exit}_exit() {";
|
||||||
push_indent;
|
push_indent;
|
||||||
append_file $exit or emit 'true';
|
append_file $exit or emit 'true';
|
||||||
@ -109,6 +109,14 @@ EOF
|
|||||||
emit '}';
|
emit '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for my $exit qw/isusable findgw/ {
|
||||||
|
emit "\nrun_${exit}_exit() {";
|
||||||
|
push_indent;
|
||||||
|
append_file($exit, 1) or emit 'true';
|
||||||
|
pop_indent;
|
||||||
|
emit '}';
|
||||||
|
}
|
||||||
|
|
||||||
emit <<'EOF';
|
emit <<'EOF';
|
||||||
################################################################################
|
################################################################################
|
||||||
# End user exit functions
|
# End user exit functions
|
||||||
|
@ -1051,6 +1051,8 @@ sub copy( $ ) {
|
|||||||
sub copy1( $ ) {
|
sub copy1( $ ) {
|
||||||
assert( $object_enabled );
|
assert( $object_enabled );
|
||||||
|
|
||||||
|
my $result = 0;
|
||||||
|
|
||||||
if ( $object ) {
|
if ( $object ) {
|
||||||
my $file = $_[0];
|
my $file = $_[0];
|
||||||
|
|
||||||
@ -1076,6 +1078,7 @@ sub copy1( $ ) {
|
|||||||
$do_indent = 0;
|
$do_indent = 0;
|
||||||
print $object $_;
|
print $object $_;
|
||||||
print $object "\n";
|
print $object "\n";
|
||||||
|
$result = 1;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1087,12 +1090,16 @@ sub copy1( $ ) {
|
|||||||
print $object $_;
|
print $object $_;
|
||||||
print $object "\n";
|
print $object "\n";
|
||||||
$do_indent = ! ( $here_documents || /\\$/ );
|
$do_indent = ! ( $here_documents || /\\$/ );
|
||||||
|
|
||||||
|
$result = 1 unless $result || /^\s*$/ || /^\s*#/;
|
||||||
}
|
}
|
||||||
|
|
||||||
close IF;
|
close IF;
|
||||||
}
|
}
|
||||||
|
|
||||||
$lastlineblank = 0;
|
$lastlineblank = 0;
|
||||||
|
|
||||||
|
$result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -2481,19 +2488,29 @@ sub propagateconfig() {
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Add a shell script file to the output script -- Return true if the
|
# Add a shell script file to the output script -- Return true if the
|
||||||
# file exists and is not in /usr/share/shorewall/.
|
# file exists and is not in /usr/share/shorewall/ and is non-empty.
|
||||||
#
|
#
|
||||||
sub append_file( $ ) {
|
sub append_file( $;$ ) {
|
||||||
my $user_exit = find_file $_[0];
|
my $user_exit = find_file $_[0];
|
||||||
my $result = 0;
|
my $result = 0;
|
||||||
|
|
||||||
unless ( $user_exit =~ /^($globals{SHAREDIR})/ ) {
|
unless ( $user_exit =~ /^($globals{SHAREDIR})/ ) {
|
||||||
if ( -f $user_exit ) {
|
if ( -f $user_exit ) {
|
||||||
|
if ( $_[1] ) {
|
||||||
|
#
|
||||||
|
# Suppress progress message
|
||||||
|
#
|
||||||
|
$result = copy1 $user_exit;
|
||||||
|
} else {
|
||||||
|
#
|
||||||
|
# Include progress message -- Pretend progress_message call was in the file
|
||||||
|
#
|
||||||
$result = 1;
|
$result = 1;
|
||||||
save_progress_message "Processing $user_exit ...";
|
save_progress_message "Processing $user_exit ...";
|
||||||
copy1 $user_exit;
|
copy1 $user_exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$result;
|
$result;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Changes in Shorewall 4.4.0-Beta3
|
qChanges in Shorewall 4.4.0-Beta3
|
||||||
|
|
||||||
1) Add new macros.
|
1) Add new macros.
|
||||||
|
|
||||||
@ -8,6 +8,8 @@ Changes in Shorewall 4.4.0-Beta3
|
|||||||
|
|
||||||
4) Check for xt_LOG.
|
4) Check for xt_LOG.
|
||||||
|
|
||||||
|
5) Fix 'findgw'
|
||||||
|
|
||||||
Changes in Shorewall 4.4.0-Beta2
|
Changes in Shorewall 4.4.0-Beta2
|
||||||
|
|
||||||
1) The 'find_first_interface_address()' and
|
1) The 'find_first_interface_address()' and
|
||||||
|
@ -130,6 +130,8 @@ Shorewall 4.4.0 Beta 3
|
|||||||
shows the contents of the dynamic blacklist as in earlier
|
shows the contents of the dynamic blacklist as in earlier
|
||||||
Shorewall releases.
|
Shorewall releases.
|
||||||
|
|
||||||
|
3) The 'findgw' script produced an error if VERBOSITY > 0.
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
K N O W N P R O B L E M S R E M A I N I N G
|
K N O W N P R O B L E M S R E M A I N I N G
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user