From 9a7688474a189bbf663df76836a7c62bfd0c2673 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 22 Mar 2022 07:55:04 +0900 Subject: [PATCH 01/16] Remove executable file check Checking the executable file can be slow when the system is boot up. It causes performance degrdation of AMD. This patch is to prevent performance degradation. Change-Id: I0133598ce003e49b1d238266600b5fc415df3eeb Signed-off-by: Hwankyu Jhun --- src/launchpad-process-pool/src/launchpad.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/launchpad-process-pool/src/launchpad.c b/src/launchpad-process-pool/src/launchpad.c index 104f426..37fd7a3 100644 --- a/src/launchpad-process-pool/src/launchpad.c +++ b/src/launchpad-process-pool/src/launchpad.c @@ -2151,7 +2151,6 @@ static bool __handle_launch_event(int fd, io_condition_e cond, void *data) appinfo_t *menu_info = NULL; candidate_process_context_t *cpc = NULL; candidate_process_context_t *org_cpc = NULL; - const char *installed_storage; const char *app_path = NULL; int pid = -1; int clifd = -1; @@ -2269,22 +2268,6 @@ static bool __handle_launch_event(int fd, io_condition_e cond, void *data) goto end; } - installed_storage = bundle_get_val(kb, AUL_K_INSTALLED_STORAGE); - if (!installed_storage || strcmp(installed_storage, "external") != 0) { - if (menu_info->app_type && - (!strcmp(menu_info->app_type, "capp") || - !strcmp(menu_info->app_type, "c++app"))) { - if (access(app_path, X_OK) != 0) { - ret = -errno; - _E("%s is not executable. errno(%d)", - app_path, errno); - __send_result_to_caller(clifd, ret); - clifd = -1; - goto end; - } - } - } - if (menu_info->hwacc == NULL) { _E("[launchpad] Failed to find H/W acceleration type"); __send_result_to_caller(clifd, -EINVAL); -- 2.7.4 From 5981e0f1f4c3545fb43366887a22465fb51b983f Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 22 Mar 2022 09:15:39 +0900 Subject: [PATCH 02/16] Release version 0.18.8 Changes: - Remove executable file check Change-Id: I8f333a398b043479d993285a262ca9c0776ad929 Signed-off-by: Hwankyu Jhun --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 9d1238f..e2fcb05 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.7 +Version: 0.18.8 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From 5982b02ac90e6898a40bc39117557e83478d3675 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 15 Apr 2022 08:20:36 +0900 Subject: [PATCH 03/16] [UI Thread] Set a new environment variable To prevent race condition about calling setenv(), the launchpad sets "TIZEN_GLIB_CONTEXT" environment variable. Change-Id: I161ef17f785556b39e74d1bf4ee277d2c36e7874 Signed-off-by: Hwankyu Jhun --- src/lib/common/src/launchpad_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/common/src/launchpad_common.c b/src/lib/common/src/launchpad_common.c index 17ab641..4286a74 100644 --- a/src/lib/common/src/launchpad_common.c +++ b/src/lib/common/src/launchpad_common.c @@ -787,6 +787,7 @@ void _set_env(appinfo_t *menu_info, bundle *kb) snprintf(buf, sizeof(buf), "%d", getpid()); setenv("AUL_PID", buf, 1); + setenv("TIZEN_GLIB_CONTEXT", "0", 1); __set_lang_env(); __set_region_env(); -- 2.7.4 From a3b88f3c7e885b6700bfd17a85a840f03f08c3da Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 15 Apr 2022 09:47:03 +0900 Subject: [PATCH 04/16] Release version 0.18.9 Changes: - [UI Thread] Set a new environment variable Change-Id: I9307d945ac92ac23dcb10438a1002a42d098b591 Signed-off-by: Hwankyu Jhun --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index e2fcb05..5548027 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.8 +Version: 0.18.9 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From b67f9e7e9a31a6b2ff4f2867d2c63edd9fda7209 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Wed, 29 Jun 2022 16:26:30 +0900 Subject: [PATCH 05/16] Add cpu priority inheritance To improve performance in case of IPC call, the cpu priority is inherited from caller process. When calling register_cpu_inheritance_destination(), it can be inherited cpu priority from caller. Requires: - https://review.tizen.org/gerrit/c/platform/core/appfw/amd/+/276948 Change-Id: Ie4ed308f299efc0f76db465d3b824adeec6c1555 Signed-off-by: Changgyu Choi --- CMakeLists.txt | 1 + packaging/launchpad.spec | 2 +- src/launchpad-process-pool/CMakeLists.txt | 1 + src/launchpad-process-pool/src/launchpad.c | 38 ++++++++++++++++++++++++++---- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb3d5ca..267df09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,5 +70,6 @@ PKG_CHECK_MODULES(SECURITY_MANAGER_DEPS REQUIRED security-manager) PKG_CHECK_MODULES(TANCHOR_DEPS REQUIRED tanchor) PKG_CHECK_MODULES(TTRACE_DEPS REQUIRED ttrace) PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf) +PKG_CHECK_MODULES(CAPI_SYSTEM_RESOURCE_DEPS REQUIRED capi-system-resource) ADD_SUBDIRECTORY(src) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 5548027..a788059 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -33,6 +33,7 @@ BuildRequires: pkgconfig(iniparser) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libsmack) BuildRequires: pkgconfig(pkgmgr-installer) +BuildRequires: pkgconfig(capi-system-resource) Requires(post): /sbin/ldconfig Requires(post): /usr/bin/systemctl @@ -191,4 +192,3 @@ ln -sf ../launchpad-process-pool.service %{buildroot}%{_unitdir_user}/basic.targ %{_libdir}/*.so %{_libdir}/pkgconfig/liblaunchpad.pc %{_libdir}/pkgconfig/liblaunchpad-hydra.pc - diff --git a/src/launchpad-process-pool/CMakeLists.txt b/src/launchpad-process-pool/CMakeLists.txt index b0af4fe..caec083 100644 --- a/src/launchpad-process-pool/CMakeLists.txt +++ b/src/launchpad-process-pool/CMakeLists.txt @@ -39,6 +39,7 @@ APPLY_PKG_CONFIG(${TARGET_LAUNCHPAD_PROCESS_POOL} PUBLIC TANCHOR_DEPS TTRACE_DEPS VCONF_DEPS + CAPI_SYSTEM_RESOURCE_DEPS ) TARGET_LINK_LIBRARIES(${TARGET_LAUNCHPAD_PROCESS_POOL} PUBLIC "-lm -ldl") diff --git a/src/launchpad-process-pool/src/launchpad.c b/src/launchpad-process-pool/src/launchpad.c index 37fd7a3..5b7eb5a 100644 --- a/src/launchpad-process-pool/src/launchpad.c +++ b/src/launchpad-process-pool/src/launchpad.c @@ -15,6 +15,7 @@ */ #define _GNU_SOURCE +#include #include #include #include @@ -72,6 +73,7 @@ #define LOADERS_PATH "loaders" #define APP_DEFINED_LOADER_INFO_PATH OPT_SHARE_PATH "/" LOADERS_PATH #define COMMON_LOADER_NAME "common-loader1" +#define LAUNCHPAD_PROCESS_NAME "launchpad-process-pool" #define LAUNCHER_INFO_PATH LOADER_INFO_PATH #define REGULAR_UID_MIN 5000 @@ -784,6 +786,13 @@ static int __fork_app_process(int (*child_fn)(void *), void *arg) } if (pid == 0) { + resource_pid_t resource_st = { + pid = getpid(), + }; + ret = resource_clear_cpu_boosting(resource_st); + if (ret != 0) + _E("Failed to clear cpu boosting. error(%d)", ret); + _W("security_manager_prepare_app_candidate ++"); ret = security_manager_prepare_app_candidate(); _W("security_manager_prepare_app_candidate --"); @@ -2772,11 +2781,11 @@ static void __get_app_type_string(loader_info_t *info, char buf[], int size) strncpy(ptr, app_type, size); ptr += len; size -= len; - if (iter) { + if (iter) { (*ptr++) = ' '; size--; } - } + } } static void __add_slot_from_info(gpointer data, gpointer user_data) @@ -2834,12 +2843,12 @@ static void __add_slot_from_info(gpointer data, gpointer user_data) info->type = LAUNCHPAD_LOADER_TYPE_USER + user_slot_offset; user_slot_offset++; - __get_app_type_string(info, buf, sizeof(buf)); - _I("candidate slot. app-type(%s) loader-type(%d)", + __get_app_type_string(info, buf, sizeof(buf)); + _I("candidate slot. app-type(%s) loader-type(%d)", buf, info->type); _print_hwc_log("candidate slot. app-type(%s) loader-type(%d)", buf, info->type); - } + } } static int __add_default_slots(void) @@ -3156,6 +3165,9 @@ static gboolean __launchpad_recovery_cb(gpointer data) static int __before_loop(int argc, char **argv) { int ret; + resource_pid_t resource_st = { + .pid = getpid(), + }; _print_hwc_log("%s(%d): START", __FUNCTION__, __LINE__); ret = __sequencer_init(); @@ -3227,11 +3239,27 @@ static int __before_loop(int argc, char **argv) _log_init(); _print_hwc_log("%s(%d): END", __FUNCTION__, __LINE__); + ret = resource_register_cpu_inheritance_destination( + LAUNCHPAD_PROCESS_NAME, resource_st); + if (ret != 0) { + _E("Failed to register cpu inheritance destination. error(%d)", + ret); + } + return 0; } static void __after_loop(void) { + int ret; + + ret = resource_unregister_cpu_inheritance_destination( + LAUNCHPAD_PROCESS_NAME); + if (ret != 0) { + _E("Failed to unregister cpu inheritance destination. " + "error(%d)", ret); + } + _log_fini(); _memory_monitor_fini(); __unregister_vconf_events(); -- 2.7.4 From c3e3665f899d1e73faabd3731d530b0983fcfa52 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Fri, 1 Jul 2022 13:10:36 +0900 Subject: [PATCH 06/16] Release version 0.18.10 Changes: - Add cpu priority inheritance Change-Id: Ie3ad6cfa3bd10cb1051bea4d9d9e319aca4fb004 Signed-off-by: Changgyu Choi --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index a788059..d61b5c6 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.9 +Version: 0.18.10 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From fa72a5a868c941ec5237183bd6d7a5bf0d7f98bd Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 4 Jul 2022 19:10:30 +0900 Subject: [PATCH 07/16] Apply type converstions The dest_process parameter of resource_register_cpu_inheritance_destination() and resource_unregister_cpu_inheritance_destination() was char* type. This patch adds forced type conversions to convert to char* type. Change-Id: I2dfa722e3a1397e19e483e0e3d5950c3758599ff Signed-off-by: Hwankyu Jhun --- src/launchpad-process-pool/src/launchpad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/launchpad-process-pool/src/launchpad.c b/src/launchpad-process-pool/src/launchpad.c index 5b7eb5a..745ffa4 100644 --- a/src/launchpad-process-pool/src/launchpad.c +++ b/src/launchpad-process-pool/src/launchpad.c @@ -3240,7 +3240,7 @@ static int __before_loop(int argc, char **argv) _print_hwc_log("%s(%d): END", __FUNCTION__, __LINE__); ret = resource_register_cpu_inheritance_destination( - LAUNCHPAD_PROCESS_NAME, resource_st); + (char*)LAUNCHPAD_PROCESS_NAME, resource_st); if (ret != 0) { _E("Failed to register cpu inheritance destination. error(%d)", ret); @@ -3254,7 +3254,7 @@ static void __after_loop(void) int ret; ret = resource_unregister_cpu_inheritance_destination( - LAUNCHPAD_PROCESS_NAME); + (char*)LAUNCHPAD_PROCESS_NAME); if (ret != 0) { _E("Failed to unregister cpu inheritance destination. " "error(%d)", ret); -- 2.7.4 From 877e3292dc2e75125707b919aca16157928cb885 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 5 Jul 2022 08:44:32 +0900 Subject: [PATCH 08/16] Release version 0.18.11 Changes: - Apply type converstions Change-Id: I46ea4236057c4f137a7323ecdbc7c21121151300 Signed-off-by: Hwankyu Jhun --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index d61b5c6..3254e80 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.10 +Version: 0.18.11 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From 67527db567db540f9dccab0726653ed9424da90d Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 14 Jul 2022 13:23:49 +0900 Subject: [PATCH 09/16] Add a new environemtn variable Before executing an application, the process sets GCOV_PREFIX="/tmp" for code coverage measurement. Change-Id: Ifbdc216f7fb507a522ad4cbe631c2b81af3bb5c1 Signed-off-by: Hwankyu Jhun --- src/lib/common/src/launchpad_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/common/src/launchpad_common.c b/src/lib/common/src/launchpad_common.c index 4286a74..0717c95 100644 --- a/src/lib/common/src/launchpad_common.c +++ b/src/lib/common/src/launchpad_common.c @@ -794,6 +794,8 @@ void _set_env(appinfo_t *menu_info, bundle *kb) #ifdef TIZEN_FEATURE_SET_PERSONALITY_32 __set_execution_domain(); #endif /* TIZEN_FEATURE_SET_PERSONALITY_32 */ + + setenv("GCOV_PREFIX", "/tmp", 1); } char **_create_argc_argv(bundle *kb, int *margc) -- 2.7.4 From 734051cd151271c31d8fb5532355b021b333db9c Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 14 Jul 2022 15:40:18 +0900 Subject: [PATCH 10/16] Release version 0.18.12 Changes: - Add a new environemtn variable Change-Id: I83a4a7a3b151bea2910f59c69f184637b1219c84 Signed-off-by: Hwankyu Jhun --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 3254e80..001dcc0 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.11 +Version: 0.18.12 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From a6844133bfc3786f279dd7bdab165e723dd88f17 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Mon, 25 Jul 2022 10:45:27 +0900 Subject: [PATCH 11/16] Revert "Add cpu priority inheritance" This reverts commit b67f9e7e9a31a6b2ff4f2867d2c63edd9fda7209. Change-Id: I80317085c0a8b60ce463ab855313716f27d8709f Signed-off-by: Changgyu Choi --- CMakeLists.txt | 1 - packaging/launchpad.spec | 2 +- src/launchpad-process-pool/CMakeLists.txt | 1 - src/launchpad-process-pool/src/launchpad.c | 28 ---------------------------- 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 267df09..fb3d5ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,5 @@ PKG_CHECK_MODULES(SECURITY_MANAGER_DEPS REQUIRED security-manager) PKG_CHECK_MODULES(TANCHOR_DEPS REQUIRED tanchor) PKG_CHECK_MODULES(TTRACE_DEPS REQUIRED ttrace) PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf) -PKG_CHECK_MODULES(CAPI_SYSTEM_RESOURCE_DEPS REQUIRED capi-system-resource) ADD_SUBDIRECTORY(src) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 001dcc0..aeb02df 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -33,7 +33,6 @@ BuildRequires: pkgconfig(iniparser) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libsmack) BuildRequires: pkgconfig(pkgmgr-installer) -BuildRequires: pkgconfig(capi-system-resource) Requires(post): /sbin/ldconfig Requires(post): /usr/bin/systemctl @@ -192,3 +191,4 @@ ln -sf ../launchpad-process-pool.service %{buildroot}%{_unitdir_user}/basic.targ %{_libdir}/*.so %{_libdir}/pkgconfig/liblaunchpad.pc %{_libdir}/pkgconfig/liblaunchpad-hydra.pc + diff --git a/src/launchpad-process-pool/CMakeLists.txt b/src/launchpad-process-pool/CMakeLists.txt index caec083..b0af4fe 100644 --- a/src/launchpad-process-pool/CMakeLists.txt +++ b/src/launchpad-process-pool/CMakeLists.txt @@ -39,7 +39,6 @@ APPLY_PKG_CONFIG(${TARGET_LAUNCHPAD_PROCESS_POOL} PUBLIC TANCHOR_DEPS TTRACE_DEPS VCONF_DEPS - CAPI_SYSTEM_RESOURCE_DEPS ) TARGET_LINK_LIBRARIES(${TARGET_LAUNCHPAD_PROCESS_POOL} PUBLIC "-lm -ldl") diff --git a/src/launchpad-process-pool/src/launchpad.c b/src/launchpad-process-pool/src/launchpad.c index 745ffa4..79bc219 100644 --- a/src/launchpad-process-pool/src/launchpad.c +++ b/src/launchpad-process-pool/src/launchpad.c @@ -15,7 +15,6 @@ */ #define _GNU_SOURCE -#include #include #include #include @@ -73,7 +72,6 @@ #define LOADERS_PATH "loaders" #define APP_DEFINED_LOADER_INFO_PATH OPT_SHARE_PATH "/" LOADERS_PATH #define COMMON_LOADER_NAME "common-loader1" -#define LAUNCHPAD_PROCESS_NAME "launchpad-process-pool" #define LAUNCHER_INFO_PATH LOADER_INFO_PATH #define REGULAR_UID_MIN 5000 @@ -786,13 +784,6 @@ static int __fork_app_process(int (*child_fn)(void *), void *arg) } if (pid == 0) { - resource_pid_t resource_st = { - pid = getpid(), - }; - ret = resource_clear_cpu_boosting(resource_st); - if (ret != 0) - _E("Failed to clear cpu boosting. error(%d)", ret); - _W("security_manager_prepare_app_candidate ++"); ret = security_manager_prepare_app_candidate(); _W("security_manager_prepare_app_candidate --"); @@ -3165,9 +3156,6 @@ static gboolean __launchpad_recovery_cb(gpointer data) static int __before_loop(int argc, char **argv) { int ret; - resource_pid_t resource_st = { - .pid = getpid(), - }; _print_hwc_log("%s(%d): START", __FUNCTION__, __LINE__); ret = __sequencer_init(); @@ -3239,27 +3227,11 @@ static int __before_loop(int argc, char **argv) _log_init(); _print_hwc_log("%s(%d): END", __FUNCTION__, __LINE__); - ret = resource_register_cpu_inheritance_destination( - (char*)LAUNCHPAD_PROCESS_NAME, resource_st); - if (ret != 0) { - _E("Failed to register cpu inheritance destination. error(%d)", - ret); - } - return 0; } static void __after_loop(void) { - int ret; - - ret = resource_unregister_cpu_inheritance_destination( - (char*)LAUNCHPAD_PROCESS_NAME); - if (ret != 0) { - _E("Failed to unregister cpu inheritance destination. " - "error(%d)", ret); - } - _log_fini(); _memory_monitor_fini(); __unregister_vconf_events(); -- 2.7.4 From 7d2a342559db65e37c749ce749ef22d69a03de41 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Mon, 25 Jul 2022 11:41:06 +0900 Subject: [PATCH 12/16] Release version 0.18.13 Changes: - Revert "Add cpu priority inheritance" Change-Id: I70f6b48c13e553bba15b980cff572b5e46fc98b2 Signed-off-by: Changgyu Choi --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index aeb02df..8fc68bf 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.12 +Version: 0.18.13 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From 293aabbf9a36260b1f0187fa6820ac35d0006376 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 25 Jul 2022 14:36:00 +0900 Subject: [PATCH 13/16] Send and receive candidate process ID The hydra loader sends a launched candidate process ID to launchpad-process-pool. When disposing the candidate process, launchpad-process-pool checks whether the candidate process is running or not to send SIGKILL signal. In the provious implementation, there is a problem that the candidate process was not terminated while it's executing. Change-Id: I88fe989f80007d9c5b6f4bb381c5ad2d863be4e8 Signed-off-by: Hwankyu Jhun --- src/launchpad-process-pool/src/launchpad.c | 14 ++++++++++++++ src/lib/launchpad-hydra/src/launchpad_hydra.c | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/src/launchpad-process-pool/src/launchpad.c b/src/launchpad-process-pool/src/launchpad.c index 79bc219..85e3c7a 100644 --- a/src/launchpad-process-pool/src/launchpad.c +++ b/src/launchpad-process-pool/src/launchpad.c @@ -1451,6 +1451,8 @@ static bool __handle_hydra_client_event(int fd, io_condition_e cond, void *data) { candidate_process_context_t *cpc = data; + int recv_pid = -1; + int ret; if (cpc == NULL) return false; @@ -1464,6 +1466,18 @@ static bool __handle_hydra_client_event(int fd, io_condition_e cond, return false; } + if (cond & IO_IN) { + ret = recv(cpc->hydra_fd, &recv_pid, sizeof(recv_pid), + MSG_WAITALL); + if (ret == -1) { + _E("recv() is failed. errno(%d)", errno); + } else { + _W("candidate process: %d", recv_pid); + if (recv_pid > 1) + cpc->pid = recv_pid; + } + } + return true; } diff --git a/src/lib/launchpad-hydra/src/launchpad_hydra.c b/src/lib/launchpad-hydra/src/launchpad_hydra.c index aa737fd..ba385db 100644 --- a/src/lib/launchpad-hydra/src/launchpad_hydra.c +++ b/src/lib/launchpad-hydra/src/launchpad_hydra.c @@ -202,6 +202,10 @@ retry_recv: __context.candidate_pid = __fork_process(__run_loader, NULL); _D("[__HYDRA__] candidate process(%d)", __context.candidate_pid); + len = send(fd, &__context.candidate_pid, + sizeof(__context.candidate_pid), MSG_NOSIGNAL); + if (len == -1) + _E("[__HYDRA__] send() is failed. errno(%d)", errno); return 0; err: @@ -437,6 +441,10 @@ API int launchpad_hydra_main(int argc, char **argv, __context.candidate_pid = __fork_process(__run_loader, NULL); _D("[__HYDRA__] candidate process(%d)", __context.candidate_pid); + if (send(__context.client_fd, &__context.candidate_pid, + sizeof(__context.candidate_pid), + MSG_NOSIGNAL) == -1) + _E("[__HYDRA__] send() is failed. errno(%d)", errno); __run_loop(); -- 2.7.4 From 548c72467ab53340443b48d4ea4f03131f500667 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 25 Jul 2022 15:17:42 +0900 Subject: [PATCH 14/16] Release version 0.18.14 Changes: - Send and receive candidate process ID Change-Id: I619a48d0f237aebf3f2a3511c533ffb9fcd95919 Signed-off-by: Hwankyu Jhun --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 8fc68bf..91785ee 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.13 +Version: 0.18.14 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From e88b06163982ade242e336e4d93a748b756af0ba Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Tue, 19 Jul 2022 15:43:17 +0900 Subject: [PATCH 15/16] Implement launch of light user application Change-Id: I9ab41fe9e0dca4e2b40051a741182067a20f99f9 Signed-off-by: Ilho Kim --- src/launchpad-process-pool/src/launchpad.c | 8 +++++--- src/lib/common/inc/key.h | 1 + src/lib/launchpad/src/launchpad_lib.c | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/launchpad-process-pool/src/launchpad.c b/src/launchpad-process-pool/src/launchpad.c index 85e3c7a..1ba060b 100644 --- a/src/launchpad-process-pool/src/launchpad.c +++ b/src/launchpad-process-pool/src/launchpad.c @@ -1230,6 +1230,7 @@ static int __prepare_exec(const char *appid, const char *app_path, appinfo_t *menu_info, bundle *kb) { char *file_name; + const char *enabled_light_user; char process_name[AUL_PR_NAME]; int ret; @@ -1267,9 +1268,10 @@ static int __prepare_exec(const char *appid, const char *app_path, _debug_change_mount_namespace(); /* SET PRIVILEGES*/ - _W("security_manager_prepare_app ++"); - ret = security_manager_prepare_app(appid); - _W("security_manager_prepare_app --"); + enabled_light_user = bundle_get_val(kb, AUL_K_ENABLED_LIGHT_USER); + _W("security_manager_prepare_app2 ++"); + ret = security_manager_prepare_app2(appid, enabled_light_user); + _W("security_manager_prepare_app2 --"); if (ret != SECURITY_MANAGER_SUCCESS) return PAD_ERR_REJECTED; diff --git a/src/lib/common/inc/key.h b/src/lib/common/inc/key.h index 19493c6..8889cca 100644 --- a/src/lib/common/inc/key.h +++ b/src/lib/common/inc/key.h @@ -51,6 +51,7 @@ extern "C" { #define AUL_K_INSTALLED_STORAGE "__AUL_INSTALLED_STORAGE__" #define AUL_K_MOUNT_GLOBAL_RES_DIR "__AUL_MOUNT_GLOBAL_RES_DIR__" #define AUL_K_MOUNT_ALLOWED_RES_DIR "__AUL_MOUNT_ALLOWED_RES_DIR__" +#define AUL_K_ENABLED_LIGHT_USER "__AUL_ENABLED_LIGHT_USER__" #ifdef __cplusplus } diff --git a/src/lib/launchpad/src/launchpad_lib.c b/src/lib/launchpad/src/launchpad_lib.c index e14894f..437dbbe 100644 --- a/src/lib/launchpad/src/launchpad_lib.c +++ b/src/lib/launchpad/src/launchpad_lib.c @@ -65,6 +65,7 @@ static int __prepare_exec(const char *appid, const char *app_path, const char *root_path, bool global, bundle *kb) { const char *file_name = NULL; + const char *enabled_light_user; char process_name[AUL_PR_NAME] = { 0, }; int ret; struct buxton_client *bxt_cli; @@ -94,9 +95,10 @@ static int __prepare_exec(const char *appid, const char *app_path, if (ret < 0) return -1; - _W("security_manager_prepare_app ++"); - ret = security_manager_prepare_app(appid); - _W("security_manager_prepare_app --"); + enabled_light_user = bundle_get_val(kb, AUL_K_ENABLED_LIGHT_USER); + _W("security_manager_prepare_app2 ++"); + ret = security_manager_prepare_app2(appid, enabled_light_user); + _W("security_manager_prepare_app2 --"); if (ret != SECURITY_MANAGER_SUCCESS) { _E("Failed to set privileges %s:%d", appid, ret); return -1; -- 2.7.4 From 03ae0ef0750fef5422a3b29233fe31a967105436 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Fri, 5 Aug 2022 10:27:17 +0900 Subject: [PATCH 16/16] Release version 0.19.0 Changes: - Implement launch of light user application Change-Id: I090af4f7c74ff05a8fee7d1ea82df059a8a42dc7 Signed-off-by: Changgyu Choi --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 91785ee..0525399 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.18.14 +Version: 0.19.0 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4