diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 1db713a7b..8c086c99e 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -1353,7 +1353,17 @@ sub get_interface_nets ( $ ) { # sub expand_rule( $$$$$$$$$$ ) { - my ($chainref , $restriction, $rule, $source, $dest, $origdest, $target, $loglevel , $disposition, $exceptionrule ) = @_; + my ($chainref , # Chain + $restriction, # Determines what to do with interface names in the SOURCE or DEST + $rule, # Caller's matches that don't depend on the SOURCE, DEST and ORIGINAL DEST + $source, # SOURCE + $dest, # DEST + $origdest, # ORIGINAL DEST + $target, # Target ('-j' part of the rule) + $loglevel , # Log level (and tag) + $disposition, # Primative part of the target (RETURN, ACCEPT, ...) + $exceptionrule # Caller's matches used in exclusion case + ) = @_; my ($iiface, $diface, $inets, $dnets, $iexcl, $dexcl, $onets , $oexcl ); my $chain = $chainref->{name}; # diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index c23691b92..a844e95bb 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -1150,17 +1150,22 @@ sub propagateconfig() { } # -# Add a shell script file to the output script +# Add a shell script file to the output script -- Return true if the +# file exists and is not in /usr/share/shorewall/. # sub append_file( $ ) { my $user_exit = find_file $_[0]; + my $result = 0; unless ( $user_exit =~ /$globals{SHAREDIR}/ ) { if ( -f $user_exit ) { + $result = 1; save_progress_message "Processing $user_exit ..."; copy1 $user_exit; } } + + $result; } # diff --git a/Shorewall-perl/compiler.pl b/Shorewall-perl/compiler.pl index ae333390f..d975377c1 100755 --- a/Shorewall-perl/compiler.pl +++ b/Shorewall-perl/compiler.pl @@ -104,8 +104,7 @@ sub generate_script_1() { for my $exit qw/init start tcclear started stop stopped clear/ { emit "run_${exit}_exit() {"; push_indent; - append_file $exit; - emit 'true'; + append_file $exit or emit 'true'; pop_indent; emit "}\n"; }