]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Also truncate the file when writing it out.
authorDylan William Hardison <dylan@hardison.net>
Tue, 30 May 2017 13:53:35 +0000 (09:53 -0400)
committerDylan William Hardison <dylan@hardison.net>
Tue, 30 May 2017 13:55:52 +0000 (09:55 -0400)
Bugzilla/Install/Filesystem.pm

index 79eeca98e01bb354e6697eefe4453c7275269be7..22ec34a95b8b4230122c09bca5695ccc82b060e8 100644 (file)
@@ -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') {