Restore compatibility with Shorewall 3.4

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6525 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-06-12 14:32:42 +00:00
parent c3ae34f581
commit 7ffb2d7ad6
2 changed files with 40 additions and 19 deletions

View File

@ -17,9 +17,9 @@ You must install Shorewall and at least one of the compiler packages
Problems corrected in 4.0.0 Beta 5. Problems corrected in 4.0.0 Beta 5.
1) With Shorewall-perl, if a bridge port is used to qualify the SOURCE 1) With Shorewall-perl, if a bridge port was used to qualify the SOURCE
in a rule where there is also a DEST interface, then the following in a rule where there was also a DEST interface, then the following
diagnostic is produced: diagnostic was produced:
Undefined subroutine &Shorewall::Chains::source_port_to_bridge called Undefined subroutine &Shorewall::Chains::source_port_to_bridge called
at /usr/share/shorewall-perl/Shorewall/Chains.pm line 1521, <$currentfile> at /usr/share/shorewall-perl/Shorewall/Chains.pm line 1521, <$currentfile>
@ -73,6 +73,17 @@ Other changes in Shorewall 4.0.0 Beta 5.
/usr/share/shorewall-perl/compiler.pl -v 2 -d . firewall /usr/share/shorewall-perl/compiler.pl -v 2 -d . firewall
Note: For compatibility with Shorewall 3.4.2 and later 3.4
releases, options not passed on the run-line get their values from
environmental variables:
Option Variable
--verbosity VERBOSE
--export EXPORT
--directory SHOREWALL_DIR
--timestamp TIMESTAMP
To use the Shorewall::Compiler module: To use the Shorewall::Compiler module:
use lib '/usr/share/shorewall-perl'; use lib '/usr/share/shorewall-perl';
@ -82,12 +93,13 @@ Other changes in Shorewall 4.0.0 Beta 5.
configure( $export, $directory, $verbose, $timestamp ) configure( $export, $directory, $verbose, $timestamp )
The arguments corresponding to the similarly-named The arguments correspond to the similarly-named
run-line options. If passed as '', the value will be run-line options. Values passed as empty strings are
ignored. ignored.
configure will raise an exception with die if $directory The function will raise an exception with die if
is passed and does not name an existing directory. $directory is not '' and does not name an existing
directory.
Example: configure( '', '.', 2, '' ); Example: configure( '', '.', 2, '' );
@ -114,13 +126,18 @@ Other changes in Shorewall 4.0.0 Beta 5.
eval { eval {
configure( ... ) configure( ... )
compiler( ... ) compiler( ... )
} };
if ( $@ ) { if ( $@ ) {
<compilation failed> <compilation failed>
} }
} }
Warning: There is currently a memory leak in the compiler
caused by hard reference loops. I'll work to correct that
problem but it is not a high priority since compiler.pl only
calls Shorewall::Compiler::compiler once then exits.
Migration Considerations: Migration Considerations:
1) You cannot simply upgrade your existing Shorewall package. You must 1) You cannot simply upgrade your existing Shorewall package. You must
@ -128,26 +145,26 @@ Migration Considerations:
If you attempt to upgrade using the RPM, you get this result: If you attempt to upgrade using the RPM, you get this result:
gateway:~ # rpm -Uvh shorewall-3.9.2-1.noarch.rpm gateway:~ # rpm -Uvh shorewall-4.0.0.noarch.rpm
error: Failed dependencies: error: Failed dependencies:
shorewall_compiler is needed by shorewall-3.9.2-1.noarch shorewall_compiler is needed by shorewall-4.0.0-1.noarch
gateway:~ # gateway:~ #
You must either: You must either:
rpm -U shorewall-3.9.2.noarch.rpm shorewall-shell-3.9.2.noarch.rpm rpm -U shorewall-4.0.0.noarch.rpm shorewall-shell-4.0.0.noarch.rpm
or or
rpm -U shorewall-3.9.2.noarch.rpm shorewall-perl-3.9.2.noarch.rpm rpm -U shorewall-4.0.0.noarch.rpm shorewall-perl-4.0.0.noarch.rpm
or or
rpm -i shorewall-shell-3.9.2.noarch.rpm rpm -i shorewall-shell-4.0.0.noarch.rpm
rpm -U shorewall-3.9.2.noarch.rpm rpm -U shorewall-4.0.0.noarch.rpm
or or
rpm -i shorewall-perl-3.9.2.noarch.rpm rpm -i shorewall-perl-4.0.0.noarch.rpm
rpm -U shorewall-3.9.2.noarch.rpm rpm -U shorewall-4.0.0.noarch.rpm
If you are upgrading using the tarball, you must install either If you are upgrading using the tarball, you must install either
shorewall-shell or shorewall-perl before you upgrade shorewall-shell or shorewall-perl before you upgrade

View File

@ -31,12 +31,16 @@ sub usage() {
print STDERR "usage: compiler.pl [ --export ] [ --directory=<directory> ] [ --verbose={0-2} ] [ --timestamp ] [ <filename> ]\n"; print STDERR "usage: compiler.pl [ --export ] [ --directory=<directory> ] [ --verbose={0-2} ] [ --timestamp ] [ <filename> ]\n";
exit 1; exit 1;
} }
# #
# E x e c u t i o n S t a r t s H e r e # E x e c u t i o n S t a r t s H e r e
# #
Getopt::Long::Configure ('bundling'); my $export = $ENV{EXPORT} || 0;
my $shorewall_dir = $ENV{SHOREWALL_DIR} || '';
my $verbose = $ENV{VERBOSE} || 0;
my $timestamp = $ENV{TIMESTAMP} || '';
my ( $export , $shorewall_dir, $verbose, $timestamp ) = ( 0, '', '', '' ); Getopt::Long::Configure ('bundling');
my $result = GetOptions('export' => \$export, my $result = GetOptions('export' => \$export,
'e' => \$export, 'e' => \$export,
@ -48,7 +52,7 @@ my $result = GetOptions('export' => \$export,
't' => \$timestamp ); 't' => \$timestamp );
usage unless $result && @ARGV < 2; usage unless $result && @ARGV < 2;
eval { eval {
use Shorewall::Compiler; use Shorewall::Compiler;
configure( $export, $shorewall_dir, $verbose, $timestamp ); configure( $export, $shorewall_dir, $verbose, $timestamp );