summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSemun Lee <sm79.lee@samsung.com>2016-08-30 10:32:17 +0900
committerSemun Lee <sm79.lee@samsung.com>2016-08-30 10:32:17 +0900
commita58b4b3c5ca848c2d064591e579e830408f607e4 (patch)
tree8bf7f949e4a84d13ffbbad415a37966a2f3ed95c
parentb4223b56a7faf56d9bee58cba2d4b06b1906c9d5 (diff)
downloadlaunchpad-a58b4b3c5ca848c2d064591e579e830408f607e4.tar.gz
launchpad-a58b4b3c5ca848c2d064591e579e830408f607e4.tar.bz2
launchpad-a58b4b3c5ca848c2d064591e579e830408f607e4.zip
Remove mounting legacy app path
/opt/usr/apps will be bind-mounted to $HOME/apps_rw. launchpad doesn't need to mount legacy app path. Change-Id: I23217dcb2a1b571a350d7eb6633ee56a636380e4 Signed-off-by: Semun Lee <sm79.lee@samsung.com>
-rw-r--r--inc/launchpad_common.h3
-rw-r--r--packaging/launchpad.spec4
-rwxr-xr-xsrc/launchpad.c11
-rw-r--r--src/launchpad_common.c59
-rw-r--r--src/launchpad_lib.c5
5 files changed, 2 insertions, 80 deletions
diff --git a/inc/launchpad_common.h b/inc/launchpad_common.h
index 5ac9977..f1907c1 100644
--- a/inc/launchpad_common.h
+++ b/inc/launchpad_common.h
@@ -102,8 +102,5 @@ int _proc_get_attr_by_pid(int pid, char *buf, int size);
int _close_all_fds(void);
void _get_cpu_idle(long long *total, long long *idle);
-int _mount_legacy_app_path(const char *app_root_path,
- const char *pkgid);
-
#endif /* __LAUNCHPAD_COMMON_H__ */
diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec
index 878d84b..d11ed9d 100644
--- a/packaging/launchpad.spec
+++ b/packaging/launchpad.spec
@@ -83,8 +83,8 @@ cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{nam
%{_unitdir_user}/launchpad-process-pool.socket
%{_unitdir_user}/sockets.target.wants/launchpad-process-pool.socket
%{_unitdir_user}/basic.target.wants/launchpad-process-pool.service
-%caps(cap_sys_admin,cap_mac_admin,cap_setgid=ei) %{_bindir}/launchpad-process-pool
-%caps(cap_sys_admin,cap_setgid=ei) %{_bindir}/launchpad-loader
+%caps(cap_mac_admin,cap_setgid=ei) %{_bindir}/launchpad-process-pool
+%caps(cap_setgid=ei) %{_bindir}/launchpad-loader
%attr(0644,root,root) %{_libdir}/liblaunchpad.so.*
%files devel
diff --git a/src/launchpad.c b/src/launchpad.c
index 38c22c6..e573ea3 100755
--- a/src/launchpad.c
+++ b/src/launchpad.c
@@ -355,12 +355,6 @@ static int __fork_app_process(int (*child_fn)(void *), void *arg)
}
if (pid == 0) {
- ret = unshare(CLONE_NEWNS);
- if (ret != 0) {
- _E("failed to unshare mount namespace (%d)", errno);
- exit(ret);
- }
-
ret = child_fn(arg);
_E("failed to exec app process (%d)", errno);
exit(ret);
@@ -596,11 +590,6 @@ static int __exec_app_process(void *arg)
_close_all_fds();
_delete_sock_path(getpid(), getuid());
- ret = _mount_legacy_app_path(launch_arg->menu_info->root_path,
- launch_arg->menu_info->pkgid);
- if (ret != 0)
- _W("Failed to mount legacy app path(%d)", errno);
-
PERF("prepare exec - first done");
ret = __prepare_exec(launch_arg->appid, launch_arg->app_path,
launch_arg->menu_info, launch_arg->kb);
diff --git a/src/launchpad_common.c b/src/launchpad_common.c
index a7b74da..aa4b909 100644
--- a/src/launchpad_common.c
+++ b/src/launchpad_common.c
@@ -39,8 +39,6 @@
#define MAX_PATH_LEN 1024
#define MAX_CMD_BUFSZ 1024
-#define LEGACY_APP_ROOT_PATH "/opt/usr/apps"
-
#define MAX_PENDING_CONNECTIONS 10
#define CONNECT_RETRY_TIME (100 * 1000)
#define CONNECT_RETRY_COUNT 3
@@ -744,60 +742,3 @@ int _close_all_fds(void)
return 0;
}
-int _mount_legacy_app_path(const char *app_root_path,
- const char *pkgid)
-{
- const char *user_app_dir;
- int ret, i;
- char legacy_app_path[PATH_MAX];
- char user_app_data_path[PATH_MAX];
- char legacy_app_data_path[PATH_MAX];
-
- char *app_data_paths[5] = {
- "data",
- "cache",
- "shared/data",
- "shared/cache",
- "shared/trusted" };
-
- snprintf(legacy_app_path, PATH_MAX,
- "%s/%s", LEGACY_APP_ROOT_PATH, pkgid);
-
- user_app_dir = tzplatform_getenv(TZ_USER_APP);
- if (!user_app_dir) {
- _E("failed to get TZ_USER_APP value");
- return -1;
- }
-
- ret = mount(NULL, "/", NULL,
- MS_SLAVE | MS_REC, NULL);
- if (ret != 0) {
- _E("failed to set / as slave dir(%d)", ret);
- return ret;
- }
-
- /* for user private app */
- if (!strncmp(app_root_path, user_app_dir, strlen(user_app_dir))) {
- return mount(app_root_path, legacy_app_path, NULL,
- MS_BIND, NULL);
- }
-
- /* for global app */
- for (i = 0; i < 5; i++) {
- snprintf(user_app_data_path, PATH_MAX, "%s/%s/%s",
- user_app_dir, pkgid, app_data_paths[i]);
-
- if (access(user_app_data_path, F_OK) != 0)
- continue;
-
- snprintf(legacy_app_data_path, PATH_MAX, "%s/%s",
- legacy_app_path, app_data_paths[i]);
- ret = mount(user_app_data_path, legacy_app_data_path, NULL,
- MS_BIND, NULL);
- if (ret != 0)
- return ret;
- }
-
- return 0;
-}
-
diff --git a/src/launchpad_lib.c b/src/launchpad_lib.c
index 0997ce1..42c8b28 100644
--- a/src/launchpad_lib.c
+++ b/src/launchpad_lib.c
@@ -112,7 +112,6 @@ static int __default_launch_cb(bundle *kb, const char *appid,
const char *pkgid, const char *pkg_type, int loader_type)
{
char err_str[MAX_LOCAL_BUFSZ] = { 0, };
- int ret;
#ifdef _APPFW_FEATURE_PRIORITY_CHANGE
int res;
const char *high_priority = bundle_get_val(kb, AUL_K_HIGHPRIORITY);
@@ -130,10 +129,6 @@ static int __default_launch_cb(bundle *kb, const char *appid,
bundle_del(kb, AUL_K_HIGHPRIORITY);
#endif
- ret = _mount_legacy_app_path(root_path, pkgid);
- if (ret != 0)
- _W("Failed to mount legacy app path(%d)", errno);
-
if (__prepare_exec(appid, app_path, pkg_type, loader_type) < 0) {
_E("__candidate_process_prepare_exec() failed");
if (access(app_path, F_OK | R_OK)) {