From 16294163f04f5469fac4031a373ecced817eb091 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 8 Nov 2018 10:53:55 +0900 Subject: [PATCH 01/16] Release version 0.5.18 Changes: - Update preload list Change-Id: Ibfea84f8e36c6cc958e2bf839fdf70e7c19735b4 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 b56b8e1..7c0fb14 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.17 +Version: 0.5.18 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From fd1871a6d0ce3bb053d7427a0b9910692bd1669f Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 13 Nov 2018 14:01:01 +0900 Subject: [PATCH 02/16] Separate launchpad libary from launchpad package Adds packages: - liblaunchpad - liblaunchpad-devel Change-Id: Id83f2dd87dffa16990d7654ad2ea2f12d27985a8 Signed-off-by: Hwankyu Jhun --- launchpad-loader.manifest | 8 ++++++++ launchpad.manifest | 2 -- liblaunchpad.manifest | 5 +++++ packaging/launchpad.spec | 31 ++++++++++++++++++++++++++++--- 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 launchpad-loader.manifest create mode 100644 liblaunchpad.manifest diff --git a/launchpad-loader.manifest b/launchpad-loader.manifest new file mode 100644 index 0000000..e1e0a45 --- /dev/null +++ b/launchpad-loader.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/launchpad.manifest b/launchpad.manifest index ca22179..c3dd1a2 100644 --- a/launchpad.manifest +++ b/launchpad.manifest @@ -4,7 +4,5 @@ - - diff --git a/liblaunchpad.manifest b/liblaunchpad.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/liblaunchpad.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 7c0fb14..1f25fa9 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -49,7 +49,7 @@ Launchpad for launching applications %package devel Summary: Launchpad for launching applications (devel) Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Requires: liblaunchpad = %{version}-%{release} %description devel Launchpad for launching applications (devel) @@ -61,6 +61,21 @@ Group: Application Framework/Application Launcher %description -n launchpad-loader Launchpad-Loader for launching applications +%package -n liblaunchpad +Summary: Launchpad library +Group: Development/Libraries + +%description -n liblaunchpad +Launchpad library + +%package -n liblaunchpad-devel +Summary: Launchpad library (devel) +Group: Development/Libraries +Requires: liblaunchpad = %{version}-%{release} + +%description -n liblaunchpad-devel +Launchpad library (devel) + %prep %setup -q @@ -111,7 +126,6 @@ ln -sf ../launchpad-process-pool.service %{buildroot}%{_unitdir_user}/basic.targ %{_unitdir_user}/sockets.target.wants/launchpad-process-pool.socket %{_unitdir_user}/basic.target.wants/launchpad-process-pool.service %{_bindir}/launchpad-process-pool -%attr(0644,root,root) %{_libdir}/liblaunchpad.so.* %files devel %{_includedir}/launchpad/*.h @@ -119,7 +133,18 @@ ln -sf ../launchpad-process-pool.service %{buildroot}%{_unitdir_user}/basic.targ %{_libdir}/pkgconfig/*.pc %files -n launchpad-loader -%manifest %{name}.manifest +%manifest launchpad-loader.manifest %license LICENSE %{_prefix}/share/aul/default.loader %{_bindir}/launchpad-loader + +%files -n liblaunchpad +%manifest liblaunchpad.manifest +%license LICENSE +%attr(0644,root,root) %{_libdir}/liblaunchpad.so.* + +%files -n liblaunchpad-devel +%{_includedir}/launchpad/*.h +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc + -- 2.7.4 From 8834043ed27818254b2852a42ed6de50d45cca4c Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 14 Nov 2018 12:05:41 +0900 Subject: [PATCH 03/16] Release version 0.5.19 Changes: - Separate launchpad libary from launchpad package Change-Id: I33c21653b2b643c9d6361a75849931b83c271079 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 1f25fa9..3d40662 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.18 +Version: 0.5.19 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From c2dae7111740504864d6c6e10b89a33b3b094126 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 14 Nov 2018 16:53:38 +0900 Subject: [PATCH 04/16] Remove duplicated pkgconfig file installation Change-Id: I23644821bc2cf44a0db5ffbeb75112c663492dbe Signed-off-by: Hwankyu Jhun --- CMakeLists.txt | 2 ++ packaging/launchpad.spec | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c77152..573fc00 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,6 +151,8 @@ INSTALL(TARGETS ${LAUNCHPAD_LIB} DESTINATION ${LIB_INSTALL_DIR} COMPONENT Runtim INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/launchpad.h DESTINATION include/launchpad) CONFIGURE_FILE(launchpad.pc.in launchpad.pc @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/launchpad.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +CONFIGURE_FILE(launchpad.pc.in liblaunchpad.pc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblaunchpad.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 3d40662..1c43188 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -130,7 +130,7 @@ ln -sf ../launchpad-process-pool.service %{buildroot}%{_unitdir_user}/basic.targ %files devel %{_includedir}/launchpad/*.h %{_libdir}/*.so -%{_libdir}/pkgconfig/*.pc +%{_libdir}/pkgconfig/launchpad.pc %files -n launchpad-loader %manifest launchpad-loader.manifest @@ -146,5 +146,5 @@ ln -sf ../launchpad-process-pool.service %{buildroot}%{_unitdir_user}/basic.targ %files -n liblaunchpad-devel %{_includedir}/launchpad/*.h %{_libdir}/*.so -%{_libdir}/pkgconfig/*.pc +%{_libdir}/pkgconfig/liblaunchpad.pc -- 2.7.4 From ffc54d811ca26f4204a232b2bc2a135ea3654efb Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 14 Nov 2018 18:45:27 +0900 Subject: [PATCH 05/16] Release version 0.5.20 Changes: - Remove duplicated pkgconfig file installation Change-Id: Ib6f44e36dd409a39be454480b60b331343a65cc4 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 1c43188..c297fbe 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.19 +Version: 0.5.20 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From 76b565dc171c758607abb92904be0962401d4d2f Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 28 Nov 2018 13:12:20 +0900 Subject: [PATCH 06/16] Remove vc elm initialization Change-Id: Ic4bd182b44311fe0515d516d084dd2857d20c369 Signed-off-by: Hwankyu Jhun --- src/launchpad_loader.c | 108 ------------------------------------------------- 1 file changed, 108 deletions(-) diff --git a/src/launchpad_loader.c b/src/launchpad_loader.c index 0bc44c9..2de8982 100644 --- a/src/launchpad_loader.c +++ b/src/launchpad_loader.c @@ -51,13 +51,6 @@ static Evas_Object *__bg; static Evas_Object *__conform; static int __type; -static bool __vc_elm_initialized; -static void *__vc_elm_handle; -static int (*__vc_elm_initialize)(void); -static int (*__vc_elm_deinitialize)(void); -static int (*__vc_elm_set_auto_register_mode)(int, int); - - enum loader_type { TYPE_COMMON, TYPE_SW, @@ -150,105 +143,6 @@ static void __fini_window(void) } } -static void __unload_vc_elm(void) -{ - if (!__vc_elm_handle) - return; - - __vc_elm_initialize = NULL; - __vc_elm_deinitialize = NULL; - __vc_elm_set_auto_register_mode = NULL; - - dlclose(__vc_elm_handle); - __vc_elm_handle = NULL; -} - -static int __load_vc_elm(void) -{ - if (__vc_elm_handle) - return 0; - - if (access(PATH_LIB_VC_ELM, F_OK) != 0) { - _W("Failed to access %s", PATH_LIB_VC_ELM); - return -1; - } - - __vc_elm_handle = dlopen(PATH_LIB_VC_ELM, RTLD_LAZY | RTLD_GLOBAL); - if (!__vc_elm_handle) { - _E("Failed to open %s", PATH_LIB_VC_ELM); - return -1; - } - - __vc_elm_initialize = dlsym(__vc_elm_handle, "vc_elm_initialize"); - if (!__vc_elm_initialize) { - _E("Failed to load vc_elm_initialize"); - __unload_vc_elm(); - return -1; - } - - __vc_elm_deinitialize = dlsym(__vc_elm_handle, "vc_elm_deinitialize"); - if (!__vc_elm_deinitialize) { - _E("Failed to load vc_elm_deinitialize"); - __unload_vc_elm(); - return -1; - } - - __vc_elm_set_auto_register_mode = dlsym(__vc_elm_handle, - "vc_elm_set_auto_register_mode"); - if (!__vc_elm_set_auto_register_mode) { - _E("Failed to load vc_elm_set_auto_register_mode"); - __unload_vc_elm(); - return -1; - } - - return 0; -} - -static void __vc_vtauto_changed_cb(keynode_t *key, void *data) -{ - const char *name; - int vt_automode; - - name = vconf_keynode_get_name(key); - if (!name || strcmp(name, VCONFKEY_VC_VOICE_TOUCH_AUTOMODE) != 0) - return; - - vt_automode = vconf_keynode_get_bool(key); - if (vt_automode) { - if (!__vc_elm_initialized) { - __vc_elm_initialize(); - __vc_elm_initialized = true; - } - __vc_elm_set_auto_register_mode(2, 0); - } else { - __vc_elm_deinitialize(); - __vc_elm_initialized = false; - } -} - -static void __vc_elm_init(void) -{ - int vt_automode = 0; - int r; - - r = __load_vc_elm(); - if (r < 0) - return; - - vconf_notify_key_changed(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, - __vc_vtauto_changed_cb, NULL); - vconf_get_bool(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, &vt_automode); - if (vt_automode) { - if (!__vc_elm_initialized) { - __vc_elm_initialize(); - __vc_elm_initialized = true; - } - __vc_elm_set_auto_register_mode(2, 0); - } - - setenv("VC_ELM_INIT", "1", 1); -} - static void __preload_lib(bundle *b) { void *handle = NULL; @@ -327,8 +221,6 @@ static void __loader_create_cb(bundle *extra, int type, void *user_data) break; } - __vc_elm_init(); - ret = vconf_get_int(VCONFKEY_SETAPPL_APP_HW_ACCELERATION, &__sys_hwacc); if (ret != VCONF_OK) { _E("Failed to get vconf int: %s", -- 2.7.4 From d5e4fcf0334697e386042361f8eea98817338373 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 29 Nov 2018 17:49:39 +0900 Subject: [PATCH 07/16] Release version 0.5.21 Changes: - Remove vc elm initialization Change-Id: Iadacf5f319d71f0f54337f39c9d4306b594376f4 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 c297fbe..17052c4 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.20 +Version: 0.5.21 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From 0fbcdd1969571c72cc97a2a24dd76a76c42a18e3 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 18 Dec 2018 08:10:19 +0900 Subject: [PATCH 08/16] Remove calling signal finalization Sometimes, the app process is deadlock while calling the g_object_unref(). While calling fork(), gdbus thread of the parent process has a mutex locked. In the child, the mutex is in the locked state. (locked by a nonexistent thread and thus can never be unlocked.) Backtrace: - #0 0xb6132900 in syscall () from /usr/lib/libc-2.24.so - #1 0xb63aab90 in g_mutex_lock_slowpath () from /usr/lib/libglib-2.0.so.0.5200.2 - #2 0xb635bbe4 in g_source_destroy_internal () from /usr/lib/libglib-2.0.so.0.5200.2 - #3 0xb657f510 in _g_kdbus_worker_stop () from /usr/lib/libgio-2.0.so.0.5200.2 - #4 0xb65365d4 in g_dbus_connection_dispose () from /usr/lib/libgio-2.0.so.0.5200.2 - #5 0xb6434720 in g_object_unref () from /usr/lib/libgobject-2.0.so.0.5200.2 - #6 0x004e1361 in _signal_fini () from /usr/bin/launchpad-process-pool - #7 0x004dac9d in __exec_app_process () from /usr/bin/launchpad-process-pool - #8 0x004d9f0f in __fork_app_process () from /usr/bin/launchpad-process-pool - #9 0x004dc01b in __handle_launch_event () from /usr/bin/launchpad-process-pool Change-Id: Iaad316621111f2494381f440c3a7fe0ab4473731 Signed-off-by: Hwankyu Jhun --- src/launchpad.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/launchpad.c b/src/launchpad.c index 363ba3a..3fa9a2f 100755 --- a/src/launchpad.c +++ b/src/launchpad.c @@ -571,8 +571,6 @@ static int __exec_loader_process(void *arg) char **argv = arg; _signal_unblock_sigchld(); - _signal_fini(); - _close_all_fds(); _setup_stdio(basename(argv[LOADER_ARG_PATH])); @@ -1016,7 +1014,6 @@ static int __exec_app_process(void *arg) _debug_prepare_debugger(launch_arg->kb); _signal_unblock_sigchld(); - _signal_fini(); _delete_sock_path(getpid(), getuid()); -- 2.7.4 From 9aab3c099033177871d5a0599f9fd1ebd8c400b5 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 18 Dec 2018 11:05:13 +0900 Subject: [PATCH 09/16] Release version 0.5.22 Changes: - Remove calling signal finalization Change-Id: I950f5dba655dc9352d372651ce16aa2b38e5abfa 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 17052c4..dc669f1 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.21 +Version: 0.5.22 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From 1d852674ea00c02970c83d17bb96068f31f6b991 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Fri, 11 Jan 2019 10:27:25 +0900 Subject: [PATCH 10/16] Add exception handler Change-Id: Ifeef5d88ee8596fea184cbbf0bd7f4802baa5461 Signed-off-by: Junghoon Park --- src/loader_info.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/loader_info.c b/src/loader_info.c index 8fd9a8f..55ea192 100644 --- a/src/loader_info.c +++ b/src/loader_info.c @@ -195,6 +195,8 @@ static void __add_extra_array_from_list(bundle *b, const char *key, GList *list) len = g_list_length(list); array = malloc(sizeof(const char *) * len); + if (array == NULL) + return; cur = list; for (i = 0; i < len; i++) { -- 2.7.4 From 2f2a047f86dcd9bf93571b46e5cd8f3308e0fcc6 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Fri, 11 Jan 2019 10:37:33 +0900 Subject: [PATCH 11/16] Release version 0.5.23 Changes: - Add exception handler Change-Id: I00bad815a119a3239dd4433c527958cfa194defe Signed-off-by: Junghoon Park --- packaging/launchpad.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index dc669f1..f467663 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.22 +Version: 0.5.23 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From b633656811ffd4000232be633a070ca761867ec4 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 16 Jan 2019 15:27:36 +0900 Subject: [PATCH 12/16] Fix static analysis issues - Checks return values - Checks the file descriptor Change-Id: Id9bc94e63b44e959f8c1cfeb20965b44724fa592 Signed-off-by: Hwankyu Jhun --- inc/launchpad_common.h | 2 +- src/launchpad.c | 10 ++++++++- src/launchpad_common.c | 56 ++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/inc/launchpad_common.h b/inc/launchpad_common.h index 3b789f5..4662d3d 100644 --- a/inc/launchpad_common.h +++ b/inc/launchpad_common.h @@ -111,7 +111,7 @@ app_pkt_t *_recv_pkt_raw(int fd); app_pkt_t *_accept_recv_pkt_raw(int fd, int *clifd, struct ucred *cr); int _send_pkt_raw(int client_fd, app_pkt_t *pkt); int _connect_to_launchpad(int type, int id); -void _set_sock_option(int fd, int cli); +int _set_sock_option(int fd, int cli); void _set_env(appinfo_t *menu_info, bundle *kb); char **_create_argc_argv(bundle *kb, int *margc); char *_get_libdir(const char *path); diff --git a/src/launchpad.c b/src/launchpad.c index 3fa9a2f..3b2592a 100755 --- a/src/launchpad.c +++ b/src/launchpad.c @@ -432,7 +432,10 @@ static int __accept_candidate_process(int server_fd, int *out_client_fd, goto error; } - _set_sock_option(client_fd, 1); + if (_set_sock_option(client_fd, 1) < 0) { + _E("Failed to set sock option"); + goto error; + } recv_ret = recv(client_fd, &client_pid, sizeof(client_pid), MSG_WAITALL); @@ -515,6 +518,11 @@ static int __candidate_process_real_launch(int candidate_fd, app_pkt_t *pkt) static int __real_send(int clifd, int ret) { + if (clifd < 3) { + _E("Invalid parameter. clifd(%d)", clifd); + return -1; + } + if (send(clifd, &ret, sizeof(int), MSG_NOSIGNAL) < 0) { if (errno == EPIPE) { _E("send failed due to EPIPE."); diff --git a/src/launchpad_common.c b/src/launchpad_common.c index e1d22c8..da3ba04 100644 --- a/src/launchpad_common.c +++ b/src/launchpad_common.c @@ -134,21 +134,47 @@ void _get_cpu_idle(unsigned long long *total, unsigned long long *idle) *idle = iv; } -void _set_sock_option(int fd, int cli) +int _set_sock_option(int fd, int cli) { + struct timeval tv = { 5, 200 * 1000 }; /* 5.2 sec */ int size; int flag; - struct timeval tv = { 5, 200 * 1000 }; /* 5.2 sec */ + int ret; size = AUL_SOCK_MAXBUFF; - setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)); - setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); + ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)); + if (ret < 0) { + _E("Failed to set SO_SNDBUF option on socket. errno(%d)", + errno); + return -1; + } + + ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); + if (ret < 0) { + _E("Failed to set SO_RCVBUF option on socket. errno(%d)", + errno); + return -1; + } + if (cli) { - setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); + ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); + if (ret < 0) { + _E("Failed to set SO_RCVTIMEO option on socket. " \ + "errno(%d)", errno); + return -1; + } + flag = fcntl(fd, F_GETFD); flag |= FD_CLOEXEC; - fcntl(fd, F_SETFD, flag); + ret = fcntl(fd, F_SETFD, flag); + if (ret < 0) { + _E("Failed to manipulate fd(F_SETFD), errno(%d)", + errno); + return -1; + } } + + return 0; } static int __parse_app_path(const char *arg, char *out, int out_size) @@ -322,7 +348,11 @@ int _create_server_sock(const char *name) return -1; } - _set_sock_option(fd, 0); + if (_set_sock_option(fd, 0) < 0) { + _E("Failed to set sock option"); + close(fd); + return -1; + } if (listen(fd, 128) == -1) { _E("listen error"); @@ -413,7 +443,11 @@ app_pkt_t *_accept_recv_pkt_raw(int fd, int *clifd, struct ucred *cr) return NULL; } - _set_sock_option(newfd, 1); + if (_set_sock_option(newfd, 1) < 0) { + _E("Failed to set sock option"); + close(newfd); + return NULL; + } pkt = _recv_pkt_raw(newfd); if (pkt == NULL) { @@ -1175,7 +1209,11 @@ static int __create_app_socket(int pid, uid_t uid) return -1; } - _set_sock_option(fd, 0); + if (_set_sock_option(fd, 0) < 0) { + _E("Failed to set sock option"); + close(fd); + return -1; + } if (listen(fd, 128) < 0) { _E("Failed to listen %d, errno(%d)", fd, errno); -- 2.7.4 From e059bb5362d51afb84eb4ceb9f9a0d109938d90e Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 17 Jan 2019 13:41:27 +0900 Subject: [PATCH 13/16] Prepare ID file Before executing an application, the child process creates the ID file. If's for Application Manager. Change-Id: I4e561b80071c12fb786ca89cab8a968d25e159ff Signed-off-by: Hwankyu Jhun --- inc/launchpad_common.h | 1 + src/launchpad.c | 4 ++++ src/launchpad_common.c | 17 +++++++++++++++++ src/launchpad_lib.c | 4 ++++ 4 files changed, 26 insertions(+) diff --git a/inc/launchpad_common.h b/inc/launchpad_common.h index 4662d3d..4776a44 100644 --- a/inc/launchpad_common.h +++ b/inc/launchpad_common.h @@ -129,6 +129,7 @@ int _wait_tep_mount(bundle *b); int _prepare_app_socket(void); int _enable_external_pkg(bundle *b, const char *pkgid, uid_t pkg_uid); int _verify_proc_caps(void); +int _prepare_id_file(void); #endif /* __LAUNCHPAD_COMMON_H__ */ diff --git a/src/launchpad.c b/src/launchpad.c index 3b2592a..f6d5301 100755 --- a/src/launchpad.c +++ b/src/launchpad.c @@ -1005,6 +1005,10 @@ static int __prepare_exec(const char *appid, const char *app_path, ret = _prepare_app_socket(); if (ret < 0) return PAD_ERR_FAILED; + + ret = _prepare_id_file(); + if (ret < 0) + return PAD_ERR_FAILED; } return 0; diff --git a/src/launchpad_common.c b/src/launchpad_common.c index da3ba04..21cb409 100644 --- a/src/launchpad_common.c +++ b/src/launchpad_common.c @@ -1353,3 +1353,20 @@ int _verify_proc_caps(void) return 0; } + +int _prepare_id_file(void) +{ + char path[PATH_MAX]; + int fd; + + snprintf(path, sizeof(path), "/run/aul/apps/%u/%d/%s", + getuid(), getpid(), getenv("AUL_APPID")); + fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0600); + if (fd < 0) { + _E("Failed to create %s. errno(%d)", path, errno); + return -1; + } + close(fd); + + return 0; +} diff --git a/src/launchpad_lib.c b/src/launchpad_lib.c index dd7620a..4041141 100644 --- a/src/launchpad_lib.c +++ b/src/launchpad_lib.c @@ -145,6 +145,10 @@ static int __prepare_exec(const char *appid, const char *app_path, if (ret < 0) return -1; + ret = _prepare_id_file(); + if (ret < 0) + return -1; + return 0; } -- 2.7.4 From 9418989c30aa2fb4295541bed45bf3d096a589f6 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 18 Jan 2019 11:45:14 +0900 Subject: [PATCH 14/16] Release version 0.5.24 Changes: - Fix static analysis issues - Prepare ID file Change-Id: I6c70eae7bc35fdc1f32df7a5633be8ebfa8182b7 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 f467663..5280a9e 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.23 +Version: 0.5.24 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4 From e35854c0404fe5c3945a2ddb8365c9725482bd8f Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 31 Jan 2019 09:21:47 +0900 Subject: [PATCH 15/16] Fix a bug about handling loader info If there is a loader that has not been used even once, it can be executed with the wrong loader at re-run. Because, the default value of the type is zero and the first loader is also zero. This patch changes the reference value. Change-Id: I2df4d632cb1e8a3268ef0edf53a65b8cfe475513 Signed-off-by: Hwankyu Jhun --- inc/launchpad.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/launchpad.h b/inc/launchpad.h index 7c2cae8..b5a11db 100644 --- a/inc/launchpad.h +++ b/inc/launchpad.h @@ -51,7 +51,7 @@ typedef struct { enum LAUNCHPAD_TYPE { LAUNCHPAD_TYPE_UNSUPPORTED = -1, - LAUNCHPAD_TYPE_USER, + LAUNCHPAD_TYPE_USER = 1, LAUNCHPAD_TYPE_DYNAMIC = 100, LAUNCHPAD_TYPE_MAX }; -- 2.7.4 From 52fedae37733b880f04a0c1702691adc6550d38d Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 31 Jan 2019 10:00:46 +0900 Subject: [PATCH 16/16] Release version 0.5.25 Changes: - Fix a bug about handling loader info Change-Id: Ifce07a71e86a39b79a79aafc5623590920196893 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 5280a9e..b6f9392 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -1,6 +1,6 @@ Name: launchpad Summary: Launchpad for launching applications -Version: 0.5.24 +Version: 0.5.25 Release: 1 Group: Application Framework/Daemons License: Apache-2.0 -- 2.7.4