From 1b431bc8dbab15a1ad4a28ed0c3120feeb557a35 Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Wed, 24 Jan 2024 13:12:34 +0300 Subject: [PATCH] Postfix for #7951: Make it possible to handle attach errors in key holder plugin, fixed lost warnings --- src/remote/client/interface.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/remote/client/interface.cpp b/src/remote/client/interface.cpp index 061ff61dfc..d18ad1b17b 100644 --- a/src/remote/client/interface.cpp +++ b/src/remote/client/interface.cpp @@ -8412,27 +8412,27 @@ static bool init(CheckStatusWrapper* status, ClntAuthBlock& cBlock, rem_port* po } catch (const Exception& ex) { - FbLocalStatus stAttach; + FbLocalStatus stAttach, statusAfterAttach; ex.stuffException(&stAttach); const ISC_STATUS* v = stAttach->getErrors(); - if (cb && (fb_utils::containsErrorCode(v, isc_bad_crypt_key) || - fb_utils::containsErrorCode(v, isc_db_crypt_key)) && - (cb->afterAttach(status, file_name.c_str(), &stAttach) == ICryptKeyCallback::DO_RETRY)) + fb_utils::containsErrorCode(v, isc_db_crypt_key))) { - continue; + auto rc = cb->afterAttach(&statusAfterAttach, file_name.c_str(), &stAttach); + if (statusAfterAttach.isSuccess() && rc == ICryptKeyCallback::DO_RETRY) + continue; } - status->init(); throw; } // response is success if (cb) { - cb->afterAttach(status, file_name.c_str(), nullptr); - status->init(); + FbLocalStatus statusAfterAttach; + cb->afterAttach(&statusAfterAttach, file_name.c_str(), nullptr); + check(&statusAfterAttach); } return true;