From 4316cbfda2f5ec5c8bebc997f6651b42f5017b58 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Fri, 12 Jul 2019 13:09:55 +0900 Subject: [PATCH 01/16] Add dbus activation feature Change-Id: Ibf4510ed3d0e6ce022979ef69beed82de4ffbf51 Signed-off-by: Jusung Son --- CMakeLists.txt | 2 ++ org.tizen.esd.service.in | 4 ++++ packaging/esd.service | 8 +++++--- packaging/esd.spec | 7 ++++--- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 org.tizen.esd.service.in diff --git a/CMakeLists.txt b/CMakeLists.txt index ef58439..eb6a587 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,8 @@ SET_TARGET_PROPERTIES(esd PROPERTIES LINK_FLAGS "-pie -Wl,-z,relro") # pkgconfig file configure_file(esd.manifest.in esd.manifest @ONLY) +configure_file(org.tizen.esd.service.in org.tizen.esd.service @ONLY) INSTALL(TARGETS esd DESTINATION bin) INSTALL(FILES ${CMAKE_SOURCE_DIR}/eventsystem.conf DESTINATION /etc/dbus-1/system.d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.esd.service DESTINATION ${SHARE_INSTALL_PREFIX}/dbus-1/system-services/) \ No newline at end of file diff --git a/org.tizen.esd.service.in b/org.tizen.esd.service.in new file mode 100644 index 0000000..4315d2c --- /dev/null +++ b/org.tizen.esd.service.in @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=tizen.system.event.app2esd +Exec=/bin/false +SystemdService=esd.service \ No newline at end of file diff --git a/packaging/esd.service b/packaging/esd.service index 37a0556..cc8c69e 100644 --- a/packaging/esd.service +++ b/packaging/esd.service @@ -1,15 +1,17 @@ [Unit] Description=Start the Event System Daemon -Wants=wait-mount@opt-usr.service -After=wait-mount@opt-usr.service +Requires=dbus.socket buxton2.service +After=dbus.socket buxton2.service [Service] User=app_fw Group=app_fw +Type=dbus SmackProcessLabel=System +BusName=tizen.system.event.app2esd ExecStart=/usr/bin/esd Restart=on-failure RestartSec=0 [Install] -WantedBy=default.target +WantedBy=multi-user.target \ No newline at end of file diff --git a/packaging/esd.spec b/packaging/esd.spec index 95ed77a..ef615c0 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -55,9 +55,9 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install -mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants +mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/esd.service -ln -sf ../esd.service %{buildroot}%{_unitdir}/graphical.target.wants/esd.service +ln -sf ../esd.service %{buildroot}%{_unitdir}/multi-user.target.wants/esd.service %post -p /sbin/ldconfig @@ -69,7 +69,8 @@ ln -sf ../esd.service %{buildroot}%{_unitdir}/graphical.target.wants/esd.service %defattr(-,root,root,-) %{_bindir}/esd %{_unitdir}/esd.service -%{_unitdir}/graphical.target.wants/esd.service +%{_unitdir}/multi-user.target.wants/esd.service +%attr(0644,root,root) %{_datadir}/dbus-1/system-services/org.tizen.esd.service %license LICENSE %files devel -- 2.7.4 From 13ae737fe79bd2a313c9fa7a3f63171190b81400 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Tue, 16 Jul 2019 09:02:42 +0900 Subject: [PATCH 02/16] Release version 0.1.15 Changes: - Add dbus activation feature Change-Id: I4e68ddcdf011c36f63ab102d70fce99da4ee1632 Signed-off-by: Jusung Son --- packaging/esd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/esd.spec b/packaging/esd.spec index 3071edb..e973691 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -1,6 +1,6 @@ Name: esd Summary: Event system daemon -Version: 0.1.14 +Version: 0.1.15 Release: 1 Group: Application Framework/Service License: Apache-2.0 -- 2.7.4 From d4cc8e19eb130a178104b298751058789c499902 Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Thu, 25 Jul 2019 16:32:40 +0900 Subject: [PATCH 03/16] Add dbus policy for 'StartupFinished' signal - Since default policy is deny for sending signal to "tizen.system.event.app2esd", ESD couldn't get a signal for 'StartupFinished'. To get the signal, adds the policy for root user. - And adds check policy to get 'UserSessionStartupFinished'. Change-Id: I124fca229d6725c9cf4affd7b9aaf7d3e77a7816 Signed-off-by: Inkyun Kil --- eventsystem.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eventsystem.conf b/eventsystem.conf index 97d42dd..7db624f 100644 --- a/eventsystem.conf +++ b/eventsystem.conf @@ -16,6 +16,7 @@ + @@ -30,5 +31,6 @@ + -- 2.7.4 From 029ef033ca0c9e6dbfce744849d1aef8eb591862 Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Fri, 26 Jul 2019 10:49:30 +0900 Subject: [PATCH 04/16] Release version 0.1.16 Changes: - Add dbus policy for 'StartupFinished' signal Change-Id: I3ed5e740d45880d6d5068af7ac49b50e900f6931 Signed-off-by: Inkyun Kil --- packaging/esd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/esd.spec b/packaging/esd.spec index e973691..3bef4e0 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -1,6 +1,6 @@ Name: esd Summary: Event system daemon -Version: 0.1.15 +Version: 0.1.16 Release: 1 Group: Application Framework/Service License: Apache-2.0 -- 2.7.4 From 5a794d90b30f17adc40c4d4aa5369c28f1d74bf6 Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Wed, 7 Aug 2019 12:03:26 +0900 Subject: [PATCH 05/16] Remove duplicate dependency with implicit dependencies at "Type=dbus" Refs: https://www.freedesktop.org/software/systemd/man/systemd.service.html - Services with Type=dbus set automatically acquire dependencies of type Requires= and After= on dbus.socket. Change-Id: Ib799c2f8174afad6706228be4b4e6e385abc249a --- packaging/esd.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/esd.service b/packaging/esd.service index cc8c69e..e59df2e 100644 --- a/packaging/esd.service +++ b/packaging/esd.service @@ -1,7 +1,7 @@ [Unit] Description=Start the Event System Daemon -Requires=dbus.socket buxton2.service -After=dbus.socket buxton2.service +Requires=buxton2.service +After=buxton2.service [Service] User=app_fw -- 2.7.4 From 8568b7c291b0863d59837c4cd0a7de38f25b9829 Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Thu, 8 Aug 2019 09:17:38 +0900 Subject: [PATCH 06/16] Fix stack overflow gboolean is different from bool Change-Id: Ia0fd3b8b579bcc5b66ef6b15870134dae0875b79 Signed-off-by: Inkyun Kil --- src/esd_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/esd_main.c b/src/esd_main.c index 4826b08..f5de3ca 100644 --- a/src/esd_main.c +++ b/src/esd_main.c @@ -889,7 +889,7 @@ static void __esd_check_event_launch_with_eventid(gpointer data, gpointer user_d } static void __esd_launch_event_handler(char *event_name, bundle *data, - const bool is_user_event, const bool trusted, + const bool is_user_event, gboolean trusted, const uid_t sender_uid, char *sender_appid, void *user_data) { const char *val; @@ -951,7 +951,7 @@ static void __esd_launch_event_handler(char *event_name, bundle *data, eep->sender_uid = sender_uid; eep->sender_appid = sender_appid; eep->is_user_event = is_user_event; - eep->trusted = trusted; + eep->trusted = (bool)trusted; eep->user_data = (void *)user_data; __esd_check_event_launch_with_eventid(el_item, eep); free(eep); @@ -1029,7 +1029,7 @@ static void __esd_event_handler(char *event_name, bundle *data, void *user_data) if (__esd_check_event_launch_support(event_name)) __esd_launch_event_handler(event_name, data, - false, true, ROOT_USER, NULL, user_data); + false, TRUE, ROOT_USER, NULL, user_data); } static void __esd_trusted_busname_remove_item(char *bus_name) @@ -1742,7 +1742,7 @@ static void launch_on_event_from_userevent(GDBusConnection *connection, GVariant *param; int result = ES_R_OK; int len; - bool trusted; + gboolean trusted; int sender_pid; uid_t sender_uid; char *event_name; -- 2.7.4 From 8f1efaeb2862d6bf511edd38ac8878f0c8685ede Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Thu, 8 Aug 2019 09:49:21 +0900 Subject: [PATCH 07/16] Release version 0.1.17 Changes: - Remove duplicate dependency with implicit dependencies at "Type=dbus" - Fix stack overflow Change-Id: I493562e1df978b95964eac4b3e3afd47596b8e16 Signed-off-by: Inkyun Kil --- packaging/esd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/esd.spec b/packaging/esd.spec index 3bef4e0..7028009 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -1,6 +1,6 @@ Name: esd Summary: Event system daemon -Version: 0.1.16 +Version: 0.1.17 Release: 1 Group: Application Framework/Service License: Apache-2.0 -- 2.7.4 From 606e3015d0627b213a6de076bd9d5857155b6055 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Wed, 2 Oct 2019 15:12:04 +0900 Subject: [PATCH 08/16] Fix dbus policy Change-Id: Iba350147e61fb3c224d0650dd415ea327f574d9c Signed-off-by: Hyotaek Shim --- eventsystem.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/eventsystem.conf b/eventsystem.conf index 7db624f..ca20d7f 100644 --- a/eventsystem.conf +++ b/eventsystem.conf @@ -26,6 +26,7 @@ + -- 2.7.4 From 42cea404c9ced8f3d356c25c7f7e07f0cc510b7c Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Wed, 2 Oct 2019 16:15:15 +0900 Subject: [PATCH 09/16] Release version 0.1.18 Changes: - Fix dbus policy Change-Id: I3b592284e239951550e420f6b3f033c40459946e Signed-off-by: Inkyun Kil --- packaging/esd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/esd.spec b/packaging/esd.spec index 7028009..cdb63d7 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -1,6 +1,6 @@ Name: esd Summary: Event system daemon -Version: 0.1.17 +Version: 0.1.18 Release: 1 Group: Application Framework/Service License: Apache-2.0 -- 2.7.4 From 131c61ff7a57cbbd25f1cabbdf52721b63a5a3fd Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Tue, 8 Oct 2019 16:48:11 +0900 Subject: [PATCH 10/16] Fix bug that encoded bundle data is null Change-Id: Ic837ac01eef93a7398a1870653ad336e78793032 Signed-off-by: Inkyun Kil Signed-off-by: Jusung Son --- src/esd_main.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/esd_main.c b/src/esd_main.c index f5de3ca..9484e89 100644 --- a/src/esd_main.c +++ b/src/esd_main.c @@ -1548,7 +1548,7 @@ out: static void get_earlier_data_method_call(GVariant *parameters, GDBusMethodInvocation *invocation) { GVariant *param = NULL; - int result = 0; + int result = ES_R_ERROR; char *event_name = NULL; bundle *b = NULL; bundle_raw *raw = NULL; @@ -1556,25 +1556,23 @@ static void get_earlier_data_method_call(GVariant *parameters, GDBusMethodInvoca earlier_item *item; g_variant_get(parameters, "(&s)", &event_name); - - if (event_name && strlen(event_name) > 0) { - _D("event_name(%s)", event_name); - result = ES_R_OK; - } else { - _E("invalid event_name(%s)", event_name); - result = ES_R_ERROR; - } + _D("event_name(%s)", event_name); item = (earlier_item *)g_hash_table_lookup(earlier_event_table, event_name); if (item != NULL) { if (item->earlier_data) { b = bundle_dup(item->earlier_data); bundle_add_str(b, "is_earlier_data", "true"); - bundle_encode(b, &raw, &len); - bundle_free(b); + result = ES_R_OK; } } + if (result == ES_R_ERROR) + b = bundle_create(); + + bundle_encode(b, &raw, &len); + bundle_free(b); + param = g_variant_new("(iis)", result, len, raw); _D("result(%d), len(%d)", result, len); -- 2.7.4 From 4a1f63a521f1436b9b3d33a4f2bff95d7c065440 Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Thu, 17 Oct 2019 16:30:48 +0900 Subject: [PATCH 11/16] Release version 0.1.19 Changes: - Fix bug that encoded bundle data is null Change-Id: I37a05ca8055ee46a599870985ed7dbd645937e85 Signed-off-by: Inkyun Kil --- packaging/esd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/esd.spec b/packaging/esd.spec index cdb63d7..2e0a7b5 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -1,6 +1,6 @@ Name: esd Summary: Event system daemon -Version: 0.1.18 +Version: 0.1.19 Release: 1 Group: Application Framework/Service License: Apache-2.0 -- 2.7.4 From 06e98a886af57955801c76bba5d95d1599e106df Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Tue, 21 Apr 2020 21:34:39 +0900 Subject: [PATCH 12/16] [fix] Rename dbus auto-activation service file Naming rule for dbus auto-activation service file : well-known name + ".service" https://bugs.freedesktop.org/show_bug.cgi?id=99874 Change-Id: Ie70ea97b6b221196826202c4b9219c55845b1eb5 --- CMakeLists.txt | 4 ++-- packaging/esd.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb6a587..0febb69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,8 +43,8 @@ SET_TARGET_PROPERTIES(esd PROPERTIES LINK_FLAGS "-pie -Wl,-z,relro") # pkgconfig file configure_file(esd.manifest.in esd.manifest @ONLY) -configure_file(org.tizen.esd.service.in org.tizen.esd.service @ONLY) +configure_file(org.tizen.esd.service.in tizen.system.event.app2esd.service @ONLY) INSTALL(TARGETS esd DESTINATION bin) INSTALL(FILES ${CMAKE_SOURCE_DIR}/eventsystem.conf DESTINATION /etc/dbus-1/system.d) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.esd.service DESTINATION ${SHARE_INSTALL_PREFIX}/dbus-1/system-services/) \ No newline at end of file +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen.system.event.app2esd.service DESTINATION ${SHARE_INSTALL_PREFIX}/dbus-1/system-services/) diff --git a/packaging/esd.spec b/packaging/esd.spec index 2e0a7b5..aa264a4 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -70,7 +70,7 @@ ln -sf ../esd.service %{buildroot}%{_unitdir}/multi-user.target.wants/esd.servic %{_bindir}/esd %{_unitdir}/esd.service %{_unitdir}/multi-user.target.wants/esd.service -%attr(0644,root,root) %{_datadir}/dbus-1/system-services/org.tizen.esd.service +%attr(0644,root,root) %{_datadir}/dbus-1/system-services/tizen.system.event.app2esd.service %license LICENSE %files devel -- 2.7.4 From 0608c5f92f6bfd5afbba0d064eea332154b11105 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Thu, 6 Aug 2020 11:25:08 +0900 Subject: [PATCH 13/16] Change service file name according to dbus naming rule Change-Id: I34c24a24dfbb00c591463ed64f206762194bce31 Signed-off-by: Jusung Son --- CMakeLists.txt | 2 +- org.tizen.esd.service.in => tizen.system.event.app2esd.service.in | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename org.tizen.esd.service.in => tizen.system.event.app2esd.service.in (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0febb69..11e42d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ SET_TARGET_PROPERTIES(esd PROPERTIES LINK_FLAGS "-pie -Wl,-z,relro") # pkgconfig file configure_file(esd.manifest.in esd.manifest @ONLY) -configure_file(org.tizen.esd.service.in tizen.system.event.app2esd.service @ONLY) +configure_file(tizen.system.event.app2esd.service.in tizen.system.event.app2esd.service @ONLY) INSTALL(TARGETS esd DESTINATION bin) INSTALL(FILES ${CMAKE_SOURCE_DIR}/eventsystem.conf DESTINATION /etc/dbus-1/system.d) diff --git a/org.tizen.esd.service.in b/tizen.system.event.app2esd.service.in similarity index 100% rename from org.tizen.esd.service.in rename to tizen.system.event.app2esd.service.in -- 2.7.4 From 2a8cd22282e8e574a876c2726c5a9e2283157843 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Thu, 6 Aug 2020 13:05:06 +0900 Subject: [PATCH 14/16] Release version 0.1.20 Changes: - [fix] Rename dbus auto-activation service file - Change service file name according to dbus naming rule Change-Id: I4e6805914169895865de7e1e1acd78b498d52f19 Signed-off-by: Jusung Son --- packaging/esd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/esd.spec b/packaging/esd.spec index aa264a4..84b4dfa 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -1,6 +1,6 @@ Name: esd Summary: Event system daemon -Version: 0.1.19 +Version: 0.1.20 Release: 1 Group: Application Framework/Service License: Apache-2.0 -- 2.7.4 From d7b6dc0c5dd17338a5239c647bbbf7ea2417d8a3 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Mon, 21 Dec 2020 14:48:14 +0900 Subject: [PATCH 15/16] Fix wrong memory release order Change-Id: Id8841bc9b552a7856adab4671622289e8870ee5d Signed-off-by: Jusung Son --- src/esd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/esd_main.c b/src/esd_main.c index 9484e89..f34b0a4 100644 --- a/src/esd_main.c +++ b/src/esd_main.c @@ -260,8 +260,8 @@ static bool __esd_check_platform_cert(const char *pkgid, uid_t uid) _E("certsvc_certificate_get_visibility() is failed."); pkgmgrinfo_pkginfo_destroy_certinfo(certinfo); - certsvc_instance_free(instance); certsvc_certificate_free(certificate); + certsvc_instance_free(instance); _D("visibility is %d", visibility); if (visibility & CERTSVC_VISIBILITY_PLATFORM) { -- 2.7.4 From 927d468709ca9f254c544dac3e6867a564fb44c6 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Mon, 21 Dec 2020 16:07:30 +0900 Subject: [PATCH 16/16] Release version 0.1.21 Changes: - Fix wrong memory release order Change-Id: I7337dd43f676d02d46f9d4c9cb4d1c2cbb794cad Signed-off-by: Jusung Son --- packaging/esd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/esd.spec b/packaging/esd.spec index 84b4dfa..8918116 100644 --- a/packaging/esd.spec +++ b/packaging/esd.spec @@ -1,6 +1,6 @@ Name: esd Summary: Event system daemon -Version: 0.1.20 +Version: 0.1.21 Release: 1 Group: Application Framework/Service License: Apache-2.0 -- 2.7.4