From e67f38557424414f7b62089426b33602da1b9551 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 4 Dec 2015 00:03:09 -0800 Subject: [PATCH] Conform to go-common WriteFile*(path,mode) --- config/tendermint/config.go | 2 +- config/tendermint_test/config.go | 4 ++-- types/genesis.go | 2 +- types/priv_validator.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) 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)