Skip to content

Commit

Permalink
Fix permissions for log file and dynamic config directory (#517)
Browse files Browse the repository at this point in the history
* change permissions
  • Loading branch information
aphralG authored Nov 27, 2023
1 parent 33712be commit 7bc5117
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func LoadPropertiesFromFile(cfg string) error {
}
} else if errors.Is(err, fs.ErrNotExist) {
log.Infof("Writing the following file to disk: %s", dynamicCfgPath)
err = os.MkdirAll(dynamicCfgDir, 0o755)
err = os.MkdirAll(dynamicCfgDir, 0o750)
if err != nil {
return fmt.Errorf("error attempting to create directory for dynamic config (%s): %v", dynamicCfgDir, err)
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/logger/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func SetLogFile(logFile string) *os.File {
logPath = path.Join(logPath, defaultLogFile)
}

logFileHandle, err := os.OpenFile(logPath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o640)
logFileHandle, err := os.OpenFile(logPath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o600)
if err != nil {
log.Errorf("Failed to set log file, proceeding to log only to stdout/stderr: %v", err)
return nil
Expand Down
2 changes: 1 addition & 1 deletion src/core/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func EnableWritePermissionForSocket(path string) error {
case <-timeout:
return lastError
default:
lastError = os.Chmod(path, 0o660)
lastError = os.Chmod(path, 0o600)
if lastError == nil {
return nil
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7bc5117

Please sign in to comment.