From a64ae36bcc064275a0a00443e818e36a2f654cd4 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 7 Oct 2023 04:09:51 +0200 Subject: [PATCH] lib/model: Verify versioning on configuration reload (fixes #9106) (#9154) --- lib/model/model.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/model/model.go b/lib/model/model.go index 970d84c45..c8007f61d 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -2976,6 +2976,16 @@ func (*model) VerifyConfiguration(from, to config.Configuration) error { return errors.New("folder type must not be changed from/to receive-encrypted") } } + + // Verify that any requested versioning is possible to construct, or we + // will panic later when starting the folder. + for _, to := range to.Folders { + if to.Versioning.Type != "" { + if _, err := versioner.New(to); err != nil { + return err + } + } + } return nil }