From de88d9e11c38bfb7f17952e0673cfb70d152962b Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Tue, 19 Jan 2016 12:26:38 +0100 Subject: [PATCH] cynara: fix casting Cynara answer into bool type Cynara check API returns either CYNARA_API_PERMISSION_DENIED (=1) CYNARA_API_PERMISSION_ALLOWED (=2). This was badly cast in SecurityManager::Cynara class to bool type, causing both return values to be interpreted as true. Change-Id: I5c96cfab5156e7aae81103cf8cf0d91d1b8293ab --- src/common/cynara.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/cynara.cpp b/src/common/cynara.cpp index d1bbef0..923abd8 100644 --- a/src/common/cynara.cpp +++ b/src/common/cynara.cpp @@ -618,7 +618,7 @@ void Cynara::responseCallback(cynara_check_id checkId, switch (cause) { case CYNARA_CALL_CAUSE_ANSWER: LogDebug("Cynara cause: ANSWER: " << response); - promise->set_value(response); + promise->set_value(response == CYNARA_API_ACCESS_ALLOWED); break; case CYNARA_CALL_CAUSE_CANCEL: -- 2.7.4