fix prevent issue tizen_2.1 submit/tizen_2.1/20130514.054205
authorYoung Ik Cho <youngik.cho@samsung.com>
Mon, 6 May 2013 10:48:51 +0000 (19:48 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Mon, 6 May 2013 10:48:51 +0000 (19:48 +0900)
Change-Id: I04d3b89d40d5b000e483104e23388442b254040b
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
osp-service-app-loader/serviceapp_loader.c

index b49d1c8..db3b972 100644 (file)
@@ -80,8 +80,16 @@ adjust_privilege()
        }
 
        char pkgname[255] = {0, };
-       aul_app_get_pkgname_bypid(getpid(), pkgname, 255);
-       int ret = (*ppriv_func)(pkgname);
+       int ret = aul_app_get_appid_bypid(getpid(), pkgname, 255);
+       if (ret != AUL_R_OK)
+       {
+               fprintf(stderr, "Cannot acquire app from pid with 0x%x.\n", ret);
+
+               dlclose(handle);
+               return;
+       }
+
+       ret = (*ppriv_func)(pkgname);
        if (ret < 0)
        {
                fprintf(stderr, "set_privilege() returned %d\n", ret);