On 3/16/19 8:41 PM, ObNox wrote: > Hi, > > I finally found some time to convert older Shorewall installations > (5.0.12) to the latest release. > > I'm facing a problem I thought was fixed long ago, circa 2018.10.05, > although now it's a bit different in behavior. > > Upon installation, the new release tries to convert "masq" to "snat" and > fails with the following error : > > Use of uninitialized value $Shorewall::Nat::rawcurrentline in pattern > match (m//) at /usr/share/shorewall/Shorewall/Nat.pm line 511, > <$currentfile> line 7. > > and the "snat" file ends up "empty" (except the comments). > > To make sure, I tried an alternate config directory with the simplest > form of "masq" containing only : > > eth0 { source=10.0.0.1 address=1.2.3.4 proto=tcp port=smtp } > > and the result is the same so I think a bug is there :-) >
Yes there is -- patch attached. -Tom -- Tom Eastep \ Q: What do you get when you cross a mobster with Shoreline, \ an international standard? Washington, USA \ A: Someone who makes you an offer you can't http://shorewall.org \ understand \_______________________________________________
From 2f3f6ffa1576d759d6e26715a00fe8be992aee2b Mon Sep 17 00:00:00 2001 From: Tom Eastep <teas...@shorewall.net> Date: Sun, 17 Mar 2019 08:02:53 -0700 Subject: Revert "Make $update global in Config.pm" This reverts commit b9d0821acb0fc4e5af22abf3eb3e11cc467b836a. diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index d13bfb9f9..2b47fa714 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -684,7 +684,6 @@ our $shorewall_dir; # Shorewall Directory; if non-empty, search here fi our $debug; # Global debugging flag our $confess; # If true, use Carp to report errors with stack trace. -our $update; # True if this is an update our $family; # Protocol family (4 or 6) our $export; # True when compiling for export @@ -1192,7 +1191,6 @@ sub initialize( $;$$$) { $debug = 0; $confess = 0; - $update = 0; %params = (); @@ -4023,9 +4021,9 @@ sub read_a_line($) { # handle_first_entry if $first_entry; # - # Save Raw Image if we are updating + # Save Raw Image # - $rawcurrentline = $currentline if $update; + $rawcurrentline = $currentline; # # Expand Shell Variables using %params and %actparams # @@ -5595,8 +5593,8 @@ EOF # # Small functions called by get_configuration. We separate them so profiling is more useful # -sub process_shorewall_conf( $ ) { - my ( $annotate ) = @_; +sub process_shorewall_conf( $$ ) { + my ( $update, $annotate ) = @_; my $file = find_file "$product.conf"; my @vars; @@ -6177,7 +6175,7 @@ sub convert_to_version_5_2() { # sub get_configuration( $$$ ) { - ( my $export, $update, my $annotate ) = @_; + my ( $export, $update, $annotate ) = @_; $globals{EXPORT} = $export; @@ -6239,7 +6237,7 @@ sub get_configuration( $$$ ) { get_params( $export ); - process_shorewall_conf( $annotate ); + process_shorewall_conf( $update, $annotate ); ensure_config_path;
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Shorewall-users mailing list Shorewall-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/shorewall-users