Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Change config and log file permissions #16

Merged
merged 1 commit into from
Oct 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func WriteToFile(filename string, data string) error {
// WriteToLog will create a log if it doesn't exist and then append
// messages to the log
func WriteToLog(path string, data string, level string) error {
f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0755)
f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
return err
}
Expand All @@ -158,7 +158,7 @@ func CreateConfigFile(path string) error {
}

bytes, err := yaml.Marshal(&cfgFile)
err = ioutil.WriteFile(path, bytes, 0755)
err = ioutil.WriteFile(path, bytes, 0644)
if err != nil {
return err
}
Expand Down Expand Up @@ -189,7 +189,7 @@ func WriteConfig(path string, cfg *api.Config) error {
return err
}

err = ioutil.WriteFile(path, bytes, 0755)
err = ioutil.WriteFile(path, bytes, 0644)
if err != nil {
return err
}
Expand Down