lib/model: Verify versioning on configuration reload (fixes #9106) (#9154)

This commit is contained in:
Jakob Borg 2023-10-07 04:09:51 +02:00 committed by GitHub
parent 690b55360f
commit a64ae36bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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
}