Update allowed config file permissions.

This commit is contained in:
Martin Dosch 2020-10-01 19:22:26 +02:00
parent 16256985bf
commit 953a52560d

View File

@ -87,12 +87,12 @@ func parseConfig(configPath string) (configuration, error) {
// Only check file permissions if we are not running on windows.
if runtime.GOOS != "windows" {
info, _ := os.Stat(configPath)
// Check for file permissions. Must be 600, 640 or 400.
// Check for file permissions. Must be 600, 640, 440 or 400.
perm := info.Mode().Perm()
permissions := strconv.FormatInt(int64(perm), 8)
if permissions != "600" && permissions != "640" && permissions != "400" {
if permissions != "600" && permissions != "640" && permissions != "440" && permissions != "400" {
return output, errors.New("Wrong permissions for " + configPath + ": " +
permissions + " instead of 400 or 600.")
permissions + " instead of 400, 440, 600 or 640.")
}
}