Remove tempfile on error; change 'use lib' to final form

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5596 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-20 16:11:06 +00:00
parent 6f114931bf
commit 792901b42d
3 changed files with 8 additions and 4 deletions

View File

@ -94,7 +94,12 @@ sub warning_message
sub fatal_error
{
print STDERR " ERROR: @_\n";
close $object, if $object;
if ( $object ) {
close $object;
unlink $tempfile;
}
system "rm -rf $ENV{TMP_DIR}" if $ENV{TMP_DIR};
die;
}

View File

@ -192,8 +192,6 @@ sub determine_zones()
fatal_error("Invalid zone file entry: $line") if $extra;
fatal_error( "Duplicate zone name: $zone\n" ) if $zones{$zone};
if ( $zone =~ /(\w+):([\w,]+)/ ) {
$zone = $1;
@parents = split ',', $2;
@ -208,6 +206,7 @@ sub determine_zones()
fatal_error "Invalid zone name: $zone" unless "\L$zone" =~ /^[a-z]\w*$/ && length $zone <= $env{MAXZONENAMELENGTH};
fatal_error "Invalid zone name: $zone" if $zone =~ /^all2|2all$/;
fatal_error( "Duplicate zone name: $zone\n" ) if $zones{$zone};
my $zoneref = $zones{$zone} = {};
$zoneref->{parents} = \@parents;

View File

@ -41,7 +41,7 @@
# This program performs rudimentary shell variable expansion on action and macro files.
use strict;
use lib '/usr/share/shorewall/Shorewall';
use lib '/usr/share/shorewall';
use Shorewall::Common;
use Shorewall::Config;
use Shorewall::Chains;