diff --git a/config/tendermint/config.go b/config/tendermint/config.go index ea5702153..b2e220fc0 100644 --- a/config/tendermint/config.go +++ b/config/tendermint/config.go @@ -29,7 +29,7 @@ func initTMRoot(rootDir string) { if !FileExists(configFilePath) { // Ask user for moniker // moniker := cfg.Prompt("Type hostname: ", "anonymous") - MustWriteFile(configFilePath, []byte(defaultConfig("anonymous"))) + MustWriteFile(configFilePath, []byte(defaultConfig("anonymous")), 0644) } } diff --git a/config/tendermint_test/config.go b/config/tendermint_test/config.go index 2bbcb3d80..024a5c970 100644 --- a/config/tendermint_test/config.go +++ b/config/tendermint_test/config.go @@ -35,10 +35,10 @@ func initTMRoot(rootDir string) { if !FileExists(configFilePath) { // Ask user for moniker // moniker := cfg.Prompt("Type hostname: ", "anonymous") - MustWriteFile(configFilePath, []byte(defaultConfig("anonymous"))) + MustWriteFile(configFilePath, []byte(defaultConfig("anonymous")), 0644) } if !FileExists(genesisFilePath) { - MustWriteFile(genesisFilePath, []byte(defaultGenesis)) + MustWriteFile(genesisFilePath, []byte(defaultGenesis), 0644) } } diff --git a/types/genesis.go b/types/genesis.go index b9ff7e8e9..95d54f478 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -32,7 +32,7 @@ type GenesisDoc struct { // Utility method for saving GenensisDoc as JSON file. func (genDoc *GenesisDoc) SaveAs(file string) error { genDocBytes := wire.JSONBytes(genDoc) - return WriteFile(file, genDocBytes) + return WriteFile(file, genDocBytes, 0644) } //------------------------------------------------------------ diff --git a/types/priv_validator.go b/types/priv_validator.go index 67189c7c4..e2536e47d 100644 --- a/types/priv_validator.go +++ b/types/priv_validator.go @@ -111,7 +111,7 @@ func (privVal *PrivValidator) save() { PanicSanity("Cannot save PrivValidator: filePath not set") } jsonBytes := wire.JSONBytes(privVal) - err := WriteFileAtomic(privVal.filePath, jsonBytes) + err := WriteFileAtomic(privVal.filePath, jsonBytes, 0600) if err != nil { // `@; BOOM!!! PanicCrisis(err)