mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 06:33:16 +00:00
Conform to go-common WriteFile*(path,mode)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user