From: Dylan William Hardison Date: Tue, 30 May 2017 13:53:35 +0000 (-0400) Subject: Also truncate the file when writing it out. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82ea853bda02a808ea917a19ef0281efacf9fc82;p=thirdparty%2Fbugzilla.git Also truncate the file when writing it out. --- diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 79eeca98e..22ec34a95 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -690,7 +690,7 @@ sub _create_files { my $info = $files{$file}; if ($info->{overwrite} or not -f $file) { print "Creating $file...\n"; - my $fh = IO::File->new( $file, O_WRONLY | O_CREAT, $info->{perms} ) + my $fh = IO::File->new( $file, O_WRONLY | O_CREAT | O_TRUNC, $info->{perms} ) or die "unable to write $file: $!"; my $contents = $info->{contents}; if (defined $contents && ref($contents) eq 'CODE') {