From 679c20f53a6b294e7e9b0f62f83ccc628eb4b4a6 Mon Sep 17 00:00:00 2001 From: Hyunbin Lee Date: Mon, 24 Jun 2013 19:56:24 +0900 Subject: [PATCH] Move the symlink creation logic to installer Change-Id: Ic4a2bb4177bd37aad17aaba662c571ee749bab76 Signed-off-by: Hyunbin Lee --- osp-env-config.c | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/osp-env-config.c b/osp-env-config.c index 7447766..5ae53be 100644 --- a/osp-env-config.c +++ b/osp-env-config.c @@ -369,50 +369,6 @@ mount_osp_internal_paths(const char* app_rootpath, const char* pkgid) } static int -link_osp_share_path(const char* app_rootpath, const char* pkgid) -{ - char osp_app_share_path[PATH_MAX] = { 0, }; - char osp_app_share2_path[PATH_MAX] = { 0, }; - char osp_share_pkgid_path[PATH_MAX] = { 0, }; - char osp_share2_pkgid_path[PATH_MAX] = { 0, }; - - strncpy(osp_app_share_path, app_rootpath, strlen(app_rootpath)); - strncat(osp_app_share_path, "/shared/data", 12); - - strncpy(osp_share_pkgid_path, _OSP_COMPAT_SHARED_PATH, strlen(_OSP_COMPAT_SHARED_PATH)); - strncat(osp_share_pkgid_path, "share/", 6); - strncat(osp_share_pkgid_path, pkgid, strlen(pkgid)); - - strncpy(osp_app_share2_path, app_rootpath, strlen(app_rootpath)); - strncat(osp_app_share2_path, "/shared/trusted", 15); - - strncpy(osp_share2_pkgid_path, _OSP_COMPAT_SHARED_PATH, strlen(_OSP_COMPAT_SHARED_PATH)); - strncat(osp_share2_pkgid_path, "share2/", 7); - strncat(osp_share2_pkgid_path, pkgid, strlen(pkgid)); - - unlink(osp_share_pkgid_path); - unlink(osp_share2_pkgid_path); - - int ret = symlink(osp_app_share_path, osp_share_pkgid_path); - if (ret == -1 && errno != EEXIST) - { - LOGE("symlink() failed, src path: %s, dest path: %s, errno: %d (%s)", - osp_app_share_path, osp_share_pkgid_path, errno, strerror(errno)); - return -1; - } - - ret = symlink(osp_app_share2_path, osp_share2_pkgid_path); - if (ret == -1 && errno != EEXIST) - { - LOGE("symlink() failed, src path: %s, dest path: %s, errno: %d (%s)", - osp_app_share2_path, osp_share2_pkgid_path, errno, strerror(errno)); - return -1; - } - - return 0; -} - -static int create_osp_external_paths(const char* app_rootpath, const char* pkgid) { char osp_ext_apps_pkgid_path[PATH_MAX] = {0, }; @@ -699,11 +655,6 @@ do_pre_exec(const char* package_name, const char* bin_path) goto ERROR; } - if (link_osp_share_path(app_rootpath, package_id) != 0) - { - goto ERROR; - } - LOGI("[data_caging] do_pre_exec() succeeded."); free(app_rootpath); return 0; -- 2.7.4