From 9b8a60db8443450697fe7a649d8e39b06e6b6703 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 29 Jan 2022 03:37:59 +0100 Subject: [PATCH] compact: open src file readonly (#292) --- cmd/bbolt/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bbolt/main.go b/cmd/bbolt/main.go index 93e676052..4c7b885eb 100644 --- a/cmd/bbolt/main.go +++ b/cmd/bbolt/main.go @@ -1979,7 +1979,7 @@ func (cmd *CompactCommand) Run(args ...string) (err error) { initialSize := fi.Size() // Open source database. - src, err := bolt.Open(cmd.SrcPath, 0444, nil) + src, err := bolt.Open(cmd.SrcPath, 0444, &bolt.Options{ReadOnly: true}) if err != nil { return err }