[VD] Fix a smack error when getSSOGuid() 53/288853/1
authorDongHyun Song <dh81.song@samsung.com>
Fri, 2 Dec 2022 06:16:37 +0000 (15:16 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Thu, 23 Feb 2023 12:40:29 +0000 (12:40 +0000)
When use sso_get_guid(), smack error happens by access of pid
smack label.

This patch take sso_get_guid() before smack label change and set
global value.

Change-Id: Ia6faa64d9104c5bb684f30c2c17e0ed7a19ce97a
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
(cherry picked from commit f455dc5f4287ca57dbfd3fafa830a7ea408aa6f8)

wrt_app/service/device_api_router.ts
wrt_app/service/service_runner.ts

index 33692cb..1a61b62 100644 (file)
@@ -208,7 +208,7 @@ export class DeviceAPIRouter {
     if (wrt.tv) {
       global.webapis.sso = {};
       global.webapis.sso.getGuid = () => {
-        return wrt.tv?.getSSOGuid() || '';
+        return global.ssoGuid || '';
       }
       global.webapis.sso.getOspAccessToken = (clientId: string, secret: string, resolve: Function, reject?: Function) => {
         parentPort?.postMessage({ type: 'register-message', listener: 'OspAccessToken' });
index de15a91..355347c 100644 (file)
@@ -77,6 +77,8 @@ export function start(id: string, filename: string) {
     requestStopService(id);
     return;
   }
+
+  global.ssoGuid = wrt.tv?.getSSOGuid();
   wrt.setServiceAppId(id);
   wrt.security?.dropThreadPrivilege(packageId, serviceId);