Removed check for file access rights on windows.

This commit is contained in:
Martin Dosch 2019-02-21 18:20:54 +01:00
parent efc88c94f6
commit 359aa28d07

View File

@ -11,6 +11,7 @@ import (
"log"
"os"
"os/user"
"runtime"
"strconv"
"strings"
"time"
@ -62,13 +63,15 @@ func parseConfig(configPath string) (configuration, error) {
if os.IsNotExist(err) {
return output, err
}
// Check for file permissions. Must be 600 or 400.
perm := info.Mode().Perm()
permissions := strconv.FormatInt(int64(perm), 8)
if permissions != "600" && permissions != "400" {
return output, errors.New("Wrong permissions for " + configPath + ": " +
permissions + " instead of 600.")
// Only check file permissions if we are not running on windows.
if runtime.GOOS != "windows" {
// Check for file permissions. Must be 600 or 400.
perm := info.Mode().Perm()
permissions := strconv.FormatInt(int64(perm), 8)
if permissions != "600" && permissions != "400" {
return output, errors.New("Wrong permissions for " + configPath + ": " +
permissions + " instead of 600.")
}
}
// Open config file.