Set public, partner privilege when install preloaded packages 11/49611/2 accepted/tizen/mobile/20151016.043630 accepted/tizen/tv/20151016.043635 accepted/tizen/wearable/20151016.043640 submit/tizen/20151015.123553 tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorSangyoon Jang <s89.jang@samsung.com>
Thu, 15 Oct 2015 12:32:39 +0000 (21:32 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Thu, 15 Oct 2015 12:33:38 +0000 (21:33 +0900)
platform privilege includes public and parnter privilege

Change-Id: I00515fff91fe31fc22bda5516a1350693f0196ff
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
tool/pkg_privilege.c

index db6a86e36a6ed55d895fa3c063750dce573a2585..3b5f86e173b71f9a8041072e06dfb2a5cc16cfbc 100644 (file)
@@ -96,7 +96,9 @@ static app_inst_req *_prepare_request(const char *pkgid, const char *appid,
  * because cert-svc does not provide c apis in Tizen 3.0.
  * So we set default privilege as platform level temporarily.
  */
-#define DEFAULT_PRIVILEGE "http://tizen.org/privilege/internal/default/platform"
+#define DEFAULT_PRIVILEGE_PUBLIC "http://tizen.org/privilege/internal/default/public"
+#define DEFAULT_PRIVILEGE_PARTNER "http://tizen.org/privilege/internal/default/partner"
+#define DEFAULT_PRIVILEGE_PLATFORM "http://tizen.org/privilege/internal/default/platform"
 static int _insert_privilege(char *manifest, uid_t uid)
 {
        int ret;
@@ -125,9 +127,14 @@ static int _insert_privilege(char *manifest, uid_t uid)
                                                priv->text);
                }
 
-               if (getuid() == OWNER_ROOT)
+               if (getuid() == OWNER_ROOT) {
                        security_manager_app_inst_req_add_privilege(req,
-                                       DEFAULT_PRIVILEGE);
+                                       DEFAULT_PRIVILEGE_PUBLIC);
+                       security_manager_app_inst_req_add_privilege(req,
+                                       DEFAULT_PRIVILEGE_PARTNER);
+                       security_manager_app_inst_req_add_privilege(req,
+                                       DEFAULT_PRIVILEGE_PLATFORM);
+               }
 
                ret = security_manager_app_install(req);
                if (ret != SECURITY_MANAGER_SUCCESS)