From c950f89153f38cf0f8087d59cfb6200ac5ca813f Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 13 Feb 2017 20:29:09 +0900 Subject: [PATCH] Change not to reboot when error occurs in internal encryption Signed-off-by: Sungbae Yoo Change-Id: I4dd7bb8697625b958eedfc21273d291136c79763 --- server/internal-encryption.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/internal-encryption.cpp b/server/internal-encryption.cpp index d015184..4dbcf13 100644 --- a/server/internal-encryption.cpp +++ b/server/internal-encryption.cpp @@ -215,7 +215,6 @@ int InternalEncryption::encrypt(const std::string& password, unsigned int option } INFO("Encryption started..."); - ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); engine->encrypt(MasterKey, options); setOptions(options & getSupportedOptions()); INFO("Sync disk..."); @@ -223,10 +222,11 @@ int InternalEncryption::encrypt(const std::string& password, unsigned int option INFO("Encryption completed"); ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "encrypted"); + ::reboot(RB_AUTOBOOT); } catch (runtime::Exception &e) { + ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); ERROR("Encryption failed - " + std::string(e.what())); } - ::reboot(RB_AUTOBOOT); }; std::thread asyncWork(encryptWorker); @@ -266,17 +266,17 @@ int InternalEncryption::decrypt(const std::string& password) } INFO("Decryption started..."); - ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); engine->decrypt(MasterKey, getOptions()); INFO("Sync disk..."); sync(); INFO("Decryption completed"); ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "unencrypted"); + ::reboot(RB_AUTOBOOT); } catch (runtime::Exception &e) { + ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); ERROR("Decryption failed - " + std::string(e.what())); } - ::reboot(RB_AUTOBOOT); }; std::thread asyncWork(decryptWorker); -- 2.34.1