Change default config file permissions to 644

This commit is contained in:
2023-02-25 01:03:50 -07:00
parent 14390a27b2
commit 095f317865
+2 -2
View File
@@ -38,7 +38,7 @@ func (c *Config[T]) Get() (bool, error) {
c.ConfigFile = &configFilepath
// open file, creating it if empty
configFile, err := os.OpenFile(*c.ConfigFile, os.O_RDWR|os.O_CREATE, 0755)
configFile, err := os.OpenFile(*c.ConfigFile, os.O_RDWR|os.O_CREATE, 0644)
defer configFile.Close()
if err != nil {
@@ -83,7 +83,7 @@ func (c *Config[T]) Write() error {
return fmt.Errorf("Could not marshal config: %w", err)
}
configFile, err := os.OpenFile(*c.ConfigFile, os.O_RDWR, 0755)
configFile, err := os.OpenFile(*c.ConfigFile, os.O_RDWR, 0644)
defer configFile.Close()
_, err = configFile.Write(data)