From: Sangyoon Jang Date: Thu, 15 Oct 2015 10:01:21 +0000 (+0900) Subject: Set default privilege when install preloaded packages X-Git-Tag: submit/tizen/20151015.123553~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c987da4fa4a6765bf91d55cbf4b639237c678d76;p=platform%2Fcore%2Fappfw%2Fslp-pkgmgr.git Set default privilege when install preloaded packages set platform level temporarily this tool will be merged to app-installer Change-Id: Ic4f852a17216ce1437c66e8380745cdf4d97f04c Signed-off-by: Sangyoon Jang --- diff --git a/tool/pkg_privilege.c b/tool/pkg_privilege.c index 08e0014..db6a86e 100644 --- a/tool/pkg_privilege.c +++ b/tool/pkg_privilege.c @@ -92,6 +92,11 @@ static app_inst_req *_prepare_request(const char *pkgid, const char *appid, return req; } +/* NOTE: We cannot use cert-svc api which checks signature level in this tool, + * 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" static int _insert_privilege(char *manifest, uid_t uid) { int ret; @@ -120,6 +125,10 @@ static int _insert_privilege(char *manifest, uid_t uid) priv->text); } + if (getuid() == OWNER_ROOT) + security_manager_app_inst_req_add_privilege(req, + DEFAULT_PRIVILEGE); + ret = security_manager_app_install(req); if (ret != SECURITY_MANAGER_SUCCESS) printf("app install failed: %d\n", ret);