File permissions on config files allow more restrictive setting (#966)

* File permissions on config files allow more restrictive setting

* Make the tests a bit more readable

* Bring back the tests dude

* Update error message

* remove else

* Add more test cases

* Change Lstat to Stat

* Add note for umask

* Make sure the permissions are 0600 or lower

* Update config file

* Do not check for windows

* Fix CI errors

* Fix CI test
This commit is contained in:
Manu Gupta
2018-12-18 07:26:04 -08:00
committed by marpio
parent aee30a4209
commit 5eba6f2e47
6 changed files with 91 additions and 53 deletions
+6 -2
View File
@@ -9,9 +9,13 @@ import (
"github.com/stretchr/testify/suite"
)
var (
func testConfigFile(t *testing.T) (testConfigFile string) {
testConfigFile = filepath.Join("..", "..", "config.dev.toml")
)
if err := os.Chmod(testConfigFile, 0700); err != nil {
t.Fatalf("%s\n", err)
}
return testConfigFile
}
type FilterTests struct {
suite.Suite