From ffc558b7f23012b1a58df5962f81c0926f24e62f Mon Sep 17 00:00:00 2001 From: Kleissner Date: Sun, 28 Nov 2021 22:05:27 +0100 Subject: [PATCH] =?UTF-8?q?Change=20file=20permission=20of=20config=20file?= =?UTF-8?q?=20to=20666=20=F0=9F=98=88=20when=20creating=20it.=20This=20is?= =?UTF-8?q?=20consistent=20with=20the=20log=20file.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config.go | 4 ++-- webapi/Download Temp.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Config.go b/Config.go index c6e8eb2..02fb0c7 100644 --- a/Config.go +++ b/Config.go @@ -116,7 +116,7 @@ func saveConfig() { return } - err = ioutil.WriteFile(configFile, data, 0644) + err = ioutil.WriteFile(configFile, data, 0666) if err != nil { Filters.LogError("saveConfig", "writing config '%s': %v\n", configFile, err.Error()) return @@ -130,7 +130,7 @@ func InitLog() (err error) { os.MkdirAll(directory, os.ModePerm) } - logFile, err := os.OpenFile(config.LogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + logFile, err := os.OpenFile(config.LogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) // 666 : All uses can read/write if err != nil { return err } diff --git a/webapi/Download Temp.go b/webapi/Download Temp.go index 9ff7564..f7c2b66 100644 --- a/webapi/Download Temp.go +++ b/webapi/Download Temp.go @@ -100,7 +100,7 @@ func (info *downloadInfo) Finish() (status int) { // initDiskFile creates the target file func (info *downloadInfo) initDiskFile(path string) (err error) { info.DiskFile.Name = path - info.DiskFile.Handle, err = os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0666) + info.DiskFile.Handle, err = os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0666) // 666 : All uses can read/write return err }