cmd/syncthing: Add a check for particular far-future version of config (fixes #1101)

This commit is contained in:
Evgeny Kuznetsov 2019-03-12 11:20:47 +03:00 committed by Audrius Butkevicius
parent 04f05f102d
commit 90d9b2de2b

View File

@ -989,6 +989,9 @@ func loadConfigAtStartup(allowNewerConfig bool) (config.Wrapper, error) {
}
if cfg.RawCopy().OriginalVersion != config.CurrentVersion {
if cfg.RawCopy().OriginalVersion == config.CurrentVersion+1101 {
l.Infof("Now, THAT's what we call a config from the future! Don't worry. As long as you hit that wire with the connecting hook at precisely eighty-eight miles per hour the instant the lightning strikes the tower... everything will be fine.")
}
if cfg.RawCopy().OriginalVersion > config.CurrentVersion && !allowNewerConfig {
return nil, fmt.Errorf("Config file version (%d) is newer than supported version (%d). If this is expected, use -allow-newer-config to override.", cfg.RawCopy().OriginalVersion, config.CurrentVersion)
}