Check if the given package is accessible when install package 37/48837/2 accepted/tizen/mobile/20151001.000020 accepted/tizen/tv/20151001.000031 accepted/tizen/wearable/20151001.000035 submit/tizen/20150930.093226
authorSangyoon Jang <s89.jang@samsung.com>
Wed, 30 Sep 2015 10:26:37 +0000 (19:26 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 30 Sep 2015 10:32:20 +0000 (19:32 +0900)
Change-Id: I332bf6748549c78fd4c59b38dd34529fc1a45561
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
client/src/pkgmgr.c

index 01c2171..27df4dc 100644 (file)
@@ -918,6 +918,11 @@ API int pkgmgr_client_usr_install(pkgmgr_client *pc, const char *pkg_type,
                return PKGMGR_R_EINVAL;
        }
 
+       if (access(pkg_path, F_OK) != 0) {
+               ERR("failed to access: %s", pkg_path);
+               return PKGMGR_R_EINVAL;
+       }
+
        /* TODO: check pkg's type on server-side */
        if (pkg_type == NULL)
                pkgtype = __get_type_from_path(pkg_path);