mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-12 13:10:25 +00:00
Removed check for file access rights on windows.
This commit is contained in:
parent
efc88c94f6
commit
359aa28d07
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user