From 202de9688a8bd42e6ba1a4957db3571844a1c915 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Wed, 14 Aug 2024 22:39:32 +0200 Subject: [PATCH] fix start_crypto handler; need to check ret == 0 --- cmd/pcloudcc/control_tools.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/pcloudcc/control_tools.cpp b/cmd/pcloudcc/control_tools.cpp index 80c6cc1..aa344a5 100644 --- a/cmd/pcloudcc/control_tools.cpp +++ b/cmd/pcloudcc/control_tools.cpp @@ -62,7 +62,11 @@ int start_crypto(const char *pass) { size_t errm_size; int result = SendCall(STARTCRYPTO, pass, &ret, &errm, &errm_size); - if (result != 0) { + + // in this case, it is not enough to check for result; the server + // should return (ret==0) indicating that the crypto folder was unlocked + // successfully. + if (result != 0 || ret != 0) { std::cout << "Start Crypto failed. return is " << ret << " and message is " << (errm ? errm : "no message") << std::endl; } else {