[Alarm][Notification] Synchronously checking access to file 62/168762/4
authorSzymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
Tue, 30 Jan 2018 14:44:53 +0000 (15:44 +0100)
committerPiotr Kosko <p.kosko@samsung.com>
Wed, 25 Apr 2018 12:30:47 +0000 (12:30 +0000)
This change affects also Alarm module.

ACR: http://suprem.sec.samsung.net/jira/browse/TWDAPI-187

Change-Id: Id1758f89a1a2e6be4c56d205c55188637d14e36a
Signed-off-by: Szymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
src/notification/common_notification.cc

index 52cc10be644e3995b71a4dc9d5c2e2b3ca7405cd..1f82493716adb44f47758a4518cbf1986509f66d 100644 (file)
@@ -23,6 +23,7 @@
 #include "common/filesystem/filesystem_provider.h"
 #include "common/logger.h"
 #include "common/scope_exit.h"
+#include "common/tools.h"
 
 namespace extension {
 namespace notification {
@@ -1080,6 +1081,8 @@ PlatformResult CommonNotification::SetPathFromJson(const picojson::value& noti_v
     const std::string& value_str = FromJson<std::string>(noti_obj, key.c_str());
     std::string real_path = FilesystemProvider::Create().GetRealPath(value_str);
 
+    CHECK_STORAGE_ACCESS_AND_RETURN(real_path);
+
     PlatformResult status = SetImage(noti_handle, type, real_path);
     CHECK_ERROR(status);
   }
@@ -1314,6 +1317,8 @@ PlatformResult CommonNotification::SetPathsArrayFromJson(const picojson::value&
       const std::string& text = JsonCast<std::string>(item);
       std::string real_path = FilesystemProvider::Create().GetRealPath(text);
 
+      CHECK_STORAGE_ACCESS_AND_RETURN(real_path);
+
       PlatformResult status = SetImage(noti_handle, map.at(idx), real_path);
       CHECK_ERROR(status);