[Tizen 7.5 Migration][Service] Apply tizen.alarm.getAll() before drop privilege 69/290069/1
authorliwei <wei90727.li@samsung.com>
Thu, 9 Mar 2023 05:21:30 +0000 (13:21 +0800)
committerDongHyun Song <dh81.song@samsung.com>
Mon, 20 Mar 2023 03:58:30 +0000 (03:58 +0000)
A new smack error while using tizen.alarm webapi.
tizen.alarm webapi use pid's smack label(/prod/tid/attr/current)
to check privilege.

So we should call tizen.alarm.getAll() before drop privilege.

subject="User::Pkg::j5SOtj71QW" object="System::Privileged"
requested=r ppid=2418 ppid_comm="wrt-service" pid=2426
comm="wrt-service" path="/proc/2426" dev="proc" ino=217674

Referenece:
https://review.tizen.org/gerrit/#/c/platform/framework/web/wrtjs/+/289512/

Change-Id: Ie949a681295dbe39563fa23e9f2e53617466ac36
Signed-off-by: liwei <wei90727.li@samsung.com>
(cherry picked from commit 74b5e6e0c55bcee1368a5bb8f741d00034bef269)

wrt_app/service/service_manager.ts

index a91715b..8ae7279 100644 (file)
@@ -96,6 +96,7 @@ let initializeExtensionOnMain = () => {
   // It must be handled ahead of dropThreadPrivilege()
   // Otherwise, smack violation might hanppen from 'libdbuspolicy'.
   global.tizen.systeminfo.getPropertyValue("CPU", () => { }, () => { });
+  global.tizen.alarm.getAll();
 }
 
 export function startService(id: string, filename: string) {