Distinguish no policy for asked privilege 85/139285/2
authorZofia Abramowska <z.abramowska@samsung.com>
Mon, 17 Jul 2017 12:00:20 +0000 (14:00 +0200)
committerZofia Abramowska <z.abramowska@samsung.com>
Tue, 18 Jul 2017 09:50:32 +0000 (11:50 +0200)
Change-Id: I90a0b9454573924c89079e03ee61528773d0d387

src/notification-daemon/Logic.cpp

index 43300c7..85d8940 100644 (file)
@@ -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;