From 7a92076f70fa214744e3fcefb7e3cacfdf184f98 Mon Sep 17 00:00:00 2001 From: Zofia Abramowska Date: Mon, 17 Jul 2017 14:00:20 +0200 Subject: [PATCH] Distinguish no policy for asked privilege Change-Id: I90a0b9454573924c89079e03ee61528773d0d387 --- src/notification-daemon/Logic.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/notification-daemon/Logic.cpp b/src/notification-daemon/Logic.cpp index 43300c7..85d8940 100644 --- a/src/notification-daemon/Logic.cpp +++ b/src/notification-daemon/Logic.cpp @@ -147,7 +147,13 @@ void Logic::popup(Protocol::ConnectionFd fd, Protocol::RequestId id, const std:: PolicyFetchRequest fetch(std::move(filter)); auto policies = fetch.fetchPolicy(); - if (policies.size() != 1) { + if (policies.size() == 0) { + ALOGE("No policy for (" << it->second.appId << ", " << it->second.user << ", " << privilege << ")"); + m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_ONCE); + return; + } + + if (policies.size() > 1) { ALOGE("Something strange happened, more than one policy for (" << it->second.appId << ", " << it->second.user << ", " << privilege << ") exists"); m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_ONCE); return; -- 2.7.4