Prevent opening file systems that were created with newer versions of CryFS

This commit is contained in:
Sebastian Messmer 2016-04-29 12:46:14 -07:00
parent 2fbed11431
commit 257b028511

View File

@ -61,6 +61,9 @@ void CryConfigLoader::_checkVersion(const CryConfig &config) {
if (!boost::starts_with(config.Version(), allowedVersionPrefix)) { if (!boost::starts_with(config.Version(), allowedVersionPrefix)) {
throw std::runtime_error(string() + "This filesystem was created with CryFS " + config.Version() + " and is incompatible. Please create a new one with your version of CryFS and migrate your data."); throw std::runtime_error(string() + "This filesystem was created with CryFS " + config.Version() + " and is incompatible. Please create a new one with your version of CryFS and migrate your data.");
} }
if (gitversion::VersionCompare::isOlderThan(gitversion::VersionString(), config.Version())) {
throw std::runtime_error(string() + "This filesystem was used with CryFS " + config.Version() + " and should not be opened with older versions anymore. Please update your CryFS version.");
}
} }
void CryConfigLoader::_checkCipher(const CryConfig &config) const { void CryConfigLoader::_checkCipher(const CryConfig &config) const {