Raise fatal error on chmod failure; Fix handling of shell variables with value zero

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6786 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-07-05 14:01:50 +00:00
parent fbb69ec909
commit 7859ea5800
4 changed files with 17 additions and 3 deletions

View File

@ -18,6 +18,10 @@ Changes in 4.0.0 RC 1
9) Allow ipsec zone in GATEWAY ZONE column of the tunnels file.
10) Raise error on chmod failure.
11) Handle shell variables with zero value correctly.
Changes in 4.0.0 Beta 6
1) First step to adding compiler debugging facility.

View File

@ -22,7 +22,7 @@ Shorewall 4.0.0 RC 1
Shorewall-perl compiler. This support utilizes the reduced-function
physdev match support available in Linux kernel 2.6.20 and later.
Problems corrected in 4.0.0 Beta 7.
Problems corrected in 4.0.0 RC 1.
1) If 'routeback' and 'detectnets' were specified on an interface,
limited broadcasts (to 255.255.255.255) and multicasts were dropped
@ -41,6 +41,12 @@ Problems corrected in 4.0.0 Beta 7.
4) ipsec zones are now allowed in the GATEWAY ZONE(S) column when
using Shorewall-perl.
5) A fatal error is now raised if the Shorewall-perl compiler is
unable to secure the output file for execute access.
6) Shell variables that have a value of zero are now handled
correctly.
Other changes in Shorewall 4.0.0 RC 1.
1) The shorewall-perl RPM may no longer be installed under Shorewall

View File

@ -331,7 +331,7 @@ sub finalize_object( $ ) {
close $object;
$object = 0;
rename $tempfile, $file or fatal_error "Cannot Rename $tempfile to $file: $!";
chmod 0700, $file;
chmod 0700, $file or fatal_error "Cannot secure $file for execute access";
progress_message3 "Shorewall configuration compiled to $file" unless $export;
}

View File

@ -553,7 +553,11 @@ sub read_a_line {
#
# Expand Shell Variables using %ENV
#
$line = join( '', $1 , ( $ENV{$2} || '' ) , $3 ) while $line =~ /^(.*?)\$([a-zA-Z]\w*)(.*)$/ || $line =~ /^(.*?)\${([a-zA-Z]\w*)}(.*)$/;
while ( $line =~ /^(.*?)\$([a-zA-Z]\w*)(.*)$/ || $line =~ /^(.*?)\${([a-zA-Z]\w*)}(.*)$/ ) {
my $val = $ENV{$2};
$val = '' unless defined $val;
$line = join( '', $1 , $val , $3 );
}
if ( $line =~ /^\s*INCLUDE\s/ ) {