summary refs log tree commit diff stats
path: root/config
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-16 16:40:29 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-16 16:40:29 -0400
commitfb3826cee5a4c23cc1135523e267fc3801e8533a (patch)
tree9b659cfd7cc5e2e8b6682bc8dcddc2582044e774 /config
parentff51625513ca45da78ac11b47fc528a280ecb2f7 (diff)
downloadaerc-fb3826cee5a4c23cc1135523e267fc3801e8533a.tar.gz
Revert "Abort if accounts.conf is world readable"
This reverts commit a755608ef9d5893b68dc4c774bbda06503481552.
Diffstat (limited to 'config')
-rw-r--r--config/config.go26
1 files changed, 1 insertions, 25 deletions
diff --git a/config/config.go b/config/config.go
index 33623d5..736acbf 100644
--- a/config/config.go
+++ b/config/config.go
@@ -3,7 +3,6 @@ package config
 import (
 	"errors"
 	"fmt"
-	"os"
 	"path"
 	"regexp"
 	"strings"
@@ -143,11 +142,7 @@ func LoadConfig(root *string) (*AercConfig, error) {
 		_root := path.Join(xdg.ConfigHome(), "aerc")
 		root = &_root
 	}
-	filename := path.Join(*root, "aerc.conf")
-	if err := checkConfigPerms(filename); err != nil {
-		return nil, err
-	}
-	file, err := ini.Load(filename)
+	file, err := ini.Load(path.Join(*root, "aerc.conf"))
 	if err != nil {
 		return nil, err
 	}
@@ -294,22 +289,3 @@ func LoadConfig(root *string) (*AercConfig, error) {
 	config.Bindings.Global.Globals = false
 	return config, nil
 }
-
-// checkConfigPerms checks for too open permissions
-// printing the fix on stdout and returning an error
-func checkConfigPerms(filename string) error {
-	info, err := os.Stat(filename)
-	if err != nil {
-		return err
-	}
-	perms := info.Mode().Perm()
-	goPerms := perms >> 3
-	// group or others have read access
-	if goPerms&0x44 != 0 {
-		fmt.Printf("The file %v has too open permissions.\n", filename)
-		fmt.Println("This is a security issue (it contains passwords).")
-		fmt.Printf("To fix it, run `chmod 600 %v`\n", filename)
-		return errors.New("account.conf permissions too lax")
-	}
-	return nil
-}