forked from extern/shorewall_code
Don't compute sha1 hash when testing
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
3f0e4959a1
commit
e49f31fb42
@ -913,7 +913,7 @@ sub compiler {
|
||||
#
|
||||
# Close, rename and secure the script
|
||||
#
|
||||
finalize_script ( $export );
|
||||
finalize_script ( $export, $test );
|
||||
#
|
||||
# And generate the auxilary config file
|
||||
#
|
||||
|
@ -2015,12 +2015,13 @@ sub generate_sha1() {
|
||||
#
|
||||
# Finalize the script file
|
||||
#
|
||||
sub finalize_script( $ ) {
|
||||
my $export = $_[0];
|
||||
sub finalize_script( $$ ) {
|
||||
my ( $export, $test ) = @_;
|
||||
close $script;
|
||||
$script = 0;
|
||||
|
||||
if ( $file ne '-' ) {
|
||||
unless ( $test ) {
|
||||
my $sha1sum = generate_sha1;
|
||||
my $sha1sum1 = join( '-', 'sha-lh', substr( $sha1sum, 0, 20 ) );
|
||||
my $sha1sum2 = join( '-', 'sha-rh', substr( $sha1sum, -20 ) );
|
||||
@ -2033,6 +2034,7 @@ sub finalize_script( $ ) {
|
||||
s/g_sha1sum2=/g_sha1sum2=$sha1sum2/;
|
||||
print;
|
||||
}
|
||||
}
|
||||
|
||||
rename $tempfile, $file or fatal_error "Cannot Rename $tempfile to $file: $!";
|
||||
chmod 0700, $file or fatal_error "Cannot secure $file for execute access";
|
||||
|
Loading…
Reference in New Issue
Block a user