From 0c9bfd6a7c11df3cc1021cbc8dc86c86394db8c3 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sun, 20 Sep 2020 19:28:48 -0400 Subject: [PATCH] Hard code file mode on disk write to 0644 which is what we would expect --- utils/files.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/utils/files.go b/utils/files.go index decd66c..32a7f01 100644 --- a/utils/files.go +++ b/utils/files.go @@ -7,11 +7,7 @@ import ( ) func WriteFile(destinationPath string, tempPath string, dataForDisk []byte) { - existingStat, err := os.Lstat(destinationPath) - if err != nil { - log.Fatalf("Error checking if file exists : %s", err) - } - if err := ioutil.WriteFile(tempPath, dataForDisk, existingStat.Mode()); err != nil { + if err := ioutil.WriteFile(tempPath, dataForDisk, 0644); err != nil { log.Fatalf("Error writing temp file : %s", err) } if err := os.Rename(tempPath, destinationPath); err != nil {