From 26425073441d57dc873d600e67206b63c7fb3233 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Mon, 6 Jun 2016 15:31:09 -0700 Subject: [PATCH] Allow loading file systems from future cryfs versions if user specifically asks for it --- src/cryfs/config/CryConfigLoader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cryfs/config/CryConfigLoader.cpp b/src/cryfs/config/CryConfigLoader.cpp index 7439608d..e483bf6a 100644 --- a/src/cryfs/config/CryConfigLoader.cpp +++ b/src/cryfs/config/CryConfigLoader.cpp @@ -58,7 +58,9 @@ optional CryConfigLoader::_loadConfig(const bf::path &filename) { void CryConfigLoader::_checkVersion(const CryConfig &config) { if (gitversion::VersionCompare::isOlderThan(gitversion::VersionString(), config.Version())) { - throw std::runtime_error(string() + "This filesystem is for CryFS " + config.Version() + " and should not be opened with older versions. Please update your CryFS version."); + if (!_console->askYesNo("This filesystem is for CryFS " + config.Version() + " and should not be opened with older versions. It is strongly recommended to update your CryFS version. However, if you have backed up your base directory and know what you're doing, you can continue trying to load it. Do you want to continue?")) { + throw std::runtime_error("Not trying to load file system."); + } } if (gitversion::VersionCompare::isOlderThan(config.Version(), gitversion::VersionString())) { if (!_console->askYesNo("This filesystem is for CryFS " + config.Version() + ". It can be migrated to CryFS " + gitversion::VersionString() + ", but afterwards couldn't be opened anymore with older versions. Do you want to migrate it?")) {