Merge pull request #12369 from hashicorp/b-peers-perms

core: write peers.json file with correct permissions
This commit is contained in:
Seth Hoenig 2022-03-24 09:18:24 -05:00 committed by GitHub
commit 65c950baf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

3
.changelog/12369.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
Write peers.json file with correct permissions
```

View File

@ -1330,7 +1330,7 @@ func (s *Server) setupRaft() error {
peersFile := filepath.Join(path, "peers.json")
peersInfoFile := filepath.Join(path, "peers.info")
if _, err := os.Stat(peersInfoFile); os.IsNotExist(err) {
if err := ioutil.WriteFile(peersInfoFile, []byte(peersInfoContent), 0755); err != nil {
if err := ioutil.WriteFile(peersInfoFile, []byte(peersInfoContent), 0644); err != nil {
return fmt.Errorf("failed to write peers.info file: %v", err)
}