Install smack rule even if fails to get app's root path 51/47551/2 accepted/tizen/mobile/20150904.140106 accepted/tizen/tv/20150904.140323 accepted/tizen/wearable/20150904.140424 submit/tizen/20150904.085212
authorSangyoon Jang <s89.jang@samsung.com>
Fri, 4 Sep 2015 11:31:20 +0000 (20:31 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Fri, 4 Sep 2015 11:34:57 +0000 (20:34 +0900)
some preload applications are not installed at /usr/apps/<pkgid>,
but we should install smack rules for these applications.
these application should fix their installation path

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

index 33b7684..194083b 100644 (file)
@@ -53,6 +53,13 @@ static app_inst_req *_prepare_request(const char *pkgid, const char *appid,
        }
 
        path = _get_path(pkgid, uid);
+       /* TODO: should be fixed */
+       if (access(path, F_OK) == -1) {
+               printf("cannot find %s, but the smack rule for %s "
+                               "will be installed\n", path, appid);
+               return req;
+       }
+
        ret = security_manager_app_inst_req_add_path(req, path,
                        SECURITY_MANAGER_PATH_RO);
        if (ret != SECURITY_MANAGER_SUCCESS) {