From 03f59b69da242f0c892b02e3a890cde570a27a84 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sat, 26 Mar 2016 23:53:08 +0800 Subject: [PATCH] Since 0.9.3-alpha set the config value cryfs.blocksizeBytes wrongly to 32768 (but didn't use the value), we have to add a workaround. --- src/cryfs/config/CryConfigLoader.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cryfs/config/CryConfigLoader.cpp b/src/cryfs/config/CryConfigLoader.cpp index 2b40bf18..779517f2 100644 --- a/src/cryfs/config/CryConfigLoader.cpp +++ b/src/cryfs/config/CryConfigLoader.cpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace bf = boost::filesystem; using cpputils::unique_ref; @@ -21,6 +22,7 @@ using std::vector; using std::string; using std::function; using std::shared_ptr; +using gitversion::VersionCompare; using namespace cpputils::logging; namespace cryfs { @@ -40,6 +42,13 @@ optional CryConfigLoader::_loadConfig(const bf::path &filename) { } std::cout << "done" << std::endl; _checkVersion(*config->config()); +#ifndef CRYFS_NO_COMPATIBILITY + //Since 0.9.3-alpha set the config value cryfs.blocksizeBytes wrongly to 32768 (but didn't use the value), we have to fix this here. + if (config->config()->Version() != "0+unknown" && VersionCompare::isOlderThan(config->config()->Version(), "0.9.3-rc1")) { + config->config()->SetBlocksizeBytes(32832); + std::cout << "Workaround BlockSize" << std::endl; + } +#endif if (config->config()->Version() != gitversion::VersionString()) { config->config()->SetVersion(gitversion::VersionString()); config->save();