From 3b9f138d792f27e417bd906ab6a593fcbac1a88a Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Wed, 30 Sep 2015 19:26:37 +0900 Subject: [PATCH] Check if the given package is accessible when install package Change-Id: I332bf6748549c78fd4c59b38dd34529fc1a45561 Signed-off-by: Sangyoon Jang --- client/src/pkgmgr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/pkgmgr.c b/client/src/pkgmgr.c index 01c2171..27df4dc 100644 --- a/client/src/pkgmgr.c +++ b/client/src/pkgmgr.c @@ -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); -- 2.7.4