Conform to go-common WriteFile*(path,mode)

This commit is contained in:
Jae Kwon
2015-12-04 00:03:09 -08:00
parent 543ca16b6f
commit e67f385574
4 changed files with 5 additions and 5 deletions

View File

@@ -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)
}
}

View File

@@ -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)
}
}

View File

@@ -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)
}
//------------------------------------------------------------

View File

@@ -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)