From f7ecb978a63c90811d881bbbbbe4397787bfff4b Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Fri, 23 Jul 2021 19:43:50 +0200 Subject: [PATCH] Use a mode when opening the db file that won't result in excessive perms. (#12160) --- physical/raft/snapshot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physical/raft/snapshot.go b/physical/raft/snapshot.go index 529c84f26..3f6e7a7d4 100644 --- a/physical/raft/snapshot.go +++ b/physical/raft/snapshot.go @@ -210,7 +210,7 @@ func (f *BoltSnapshotStore) getMetaFromDB(id string) (*raft.SnapshotMeta, error) } filename := filepath.Join(f.path, id, databaseFilename) - boltDB, err := bolt.Open(filename, 0o666, &bolt.Options{Timeout: 1 * time.Second}) + boltDB, err := bolt.Open(filename, 0o600, &bolt.Options{Timeout: 1 * time.Second}) if err != nil { return nil, err }