Remove validation for rule actions (block/sanite) when checking for leak 02/152002/1 accepted/tizen/4.0/unified/20170925.072235 submit/tizen_4.0/20170925.050152 submit/tizen_4.0/20171017.004707 tizen_4.0.IoT.p1_release
authorSaulo Moraes <s.moraes@samsung.com>
Fri, 22 Sep 2017 19:17:35 +0000 (16:17 -0300)
committerSaulo Aldighieri Moraes <s.moraes@samsung.com>
Fri, 22 Sep 2017 19:18:12 +0000 (16:18 -0300)
Change-Id: I718939bd7ff7dac636d5a1442bb024ef5dd16745
Signed-off-by: Saulo Aldighieri Moraes <s.moraes@samsung.com>
client/src/DlpLogsManager.cpp
client/src/privacy_guard_dlp.cpp

index 04e4bc3d1ecd0178ca156a0f2aa409e4fc237058..e8b71c60a82e97fb1bb0d07cd494cc847db8c52b 100644 (file)
@@ -61,14 +61,17 @@ DlpLogsManager::ParseAndLogLeak(const char *hostname, char *mem, size_t len, con
        entry.len = len;
        entry.rlist = rules;
 
-       // check if we have only ALLOW actions on the rules list
-       for (auto &it : rules) {
-               if (it.action != PRIV_GUARD_DLP_ACTION_ALLOW) {
-                       // if we have any rule different from ALLOW we need to parse now
-                       res = ParseAndLogLeakNow(entry);
-                       break;
-               }
-       }
+       /** This verification is not necessary in current implementation
+        *  as it supports only ALLOW action.
+        * // check if we have only ALLOW actions on the rules list
+        * for (auto &it : rules) {
+        *      if (it.action != PRIV_GUARD_DLP_ACTION_ALLOW) {
+        *              // if we have any rule different from ALLOW we need to parse now
+        *              res = ParseAndLogLeakNow(entry);
+        *              break;
+        *      }
+        *}
+        */
 
        if (!entry.rlist.empty() || !entry.llist.empty()) {
                // add entry to the m_logQueue to be processed when the thread awakes
index dd35806e02c79c5aaab07cc8df60b662229e3347..7b98265bfb4c37da56217814ab8a70f14be728ab 100644 (file)
@@ -45,14 +45,13 @@ PgDlpResult privacy_guard_dlp_check_leak(const char *hostname, char * const mem,
        clock_gettime(CLOCK_REALTIME, &tp_before);
 #endif
        current_rules_list rules;
-       PgDlpResult res;
        DlpRulesManager *pRules = DlpRulesManager::getInstance();
        DlpLogsManager *pLogs = DlpLogsManager::getInstance();
 
        /* return DENY if called with NULL values or zero len */
        if (hostname == NULL || mem == NULL || len == 0) {
                PG_LOGE("DLP check leak received and empty request, message denied");
-               return PRIV_GUARD_DLP_RESULT_DENY;
+               return PRIV_GUARD_DLP_RESULT_ALLOW;
        }
 
        /* get cached rules from server */
@@ -67,7 +66,7 @@ PgDlpResult privacy_guard_dlp_check_leak(const char *hostname, char * const mem,
                return PRIV_GUARD_DLP_RESULT_ALLOW;
        }
 
-       res = pLogs->ParseAndLogLeak(hostname, mem, len, rules);
+       pLogs->ParseAndLogLeak(hostname, mem, len, rules);
 
 #ifdef PERF_TEST
        clock_gettime(CLOCK_REALTIME, &tp_after);
@@ -75,14 +74,6 @@ PgDlpResult privacy_guard_dlp_check_leak(const char *hostname, char * const mem,
        PG_LOGD("DLP check time: %ld us", interval);
 #endif
 
-#ifdef _PRIVACY_GUARD_DEBUG
-       if (res == PRIV_GUARD_DLP_RESULT_ALLOW) {
-               PG_LOGD("Packet allowed");
-       } else {
-               PG_LOGD("Packet denied");
-       }
-#endif
-
-       return res;
+       return PRIV_GUARD_DLP_RESULT_ALLOW;
 }