diff --git a/app/utils/vrf_key.go b/app/utils/vrf_key.go index a248a4ff..c5e0cc8e 100644 --- a/app/utils/vrf_key.go +++ b/app/utils/vrf_key.go @@ -227,7 +227,7 @@ func LoadVRFKey(keyFilePath string) (*VRFKey, error) { func InitializeVRFKey(config *cfg.Config) (vrfPubKey sdkcrypto.PubKey, err error) { pvKeyFile := config.PrivValidatorKeyFile() - if err := os.MkdirAll(filepath.Dir(pvKeyFile), 0o600); err != nil { + if err := os.MkdirAll(filepath.Dir(pvKeyFile), 0o700); err != nil { return nil, fmt.Errorf("could not create directory %q: %w", filepath.Dir(pvKeyFile), err) } diff --git a/cmd/sedad/cmd/init.go b/cmd/sedad/cmd/init.go index 81c9a097..5c0e61d6 100644 --- a/cmd/sedad/cmd/init.go +++ b/cmd/sedad/cmd/init.go @@ -38,11 +38,11 @@ func readInMnemonic(cmd *cobra.Command) (string, error) { func configureValidatorFiles(config *cfg.Config) error { keyFilePath := config.PrivValidatorKeyFile() - if err := os.MkdirAll(filepath.Dir(keyFilePath), 0o600); err != nil { + if err := os.MkdirAll(filepath.Dir(keyFilePath), 0o700); err != nil { return fmt.Errorf("could not create directory %q: %w", filepath.Dir(keyFilePath), err) } stateFilePath := config.PrivValidatorStateFile() - if err := os.MkdirAll(filepath.Dir(stateFilePath), 0o600); err != nil { + if err := os.MkdirAll(filepath.Dir(stateFilePath), 0o700); err != nil { return fmt.Errorf("could not create directory %q: %w", filepath.Dir(stateFilePath), err) } diff --git a/e2e/util.go b/e2e/util.go index e36b2785..c495535b 100644 --- a/e2e/util.go +++ b/e2e/util.go @@ -61,7 +61,7 @@ func writeFile(path string, body []byte) error { return err } - return os.WriteFile(path, body, 0o600) + return os.WriteFile(path, body, 0o700) } func decodeTx(txBytes []byte) (*sdktx.Tx, error) { diff --git a/e2e/validator.go b/e2e/validator.go index 91ea02d3..804f5f8a 100644 --- a/e2e/validator.go +++ b/e2e/validator.go @@ -63,7 +63,7 @@ func (v *validator) configDir() string { func (v *validator) createConfig() error { p := path.Join(v.configDir(), "config") - return os.MkdirAll(p, 0o600) + return os.MkdirAll(p, 0o700) } func (v *validator) init() error { @@ -117,12 +117,12 @@ func (v *validator) createConsensusKey() error { config.Moniker = v.moniker pvKeyFile := config.PrivValidatorKeyFile() - if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o600); err != nil { + if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o700); err != nil { return err } pvStateFile := config.PrivValidatorStateFile() - if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o600); err != nil { + if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o700); err != nil { return err }