From 12045bfedb7f8deaac7143fbf3a42e9188ecf538 Mon Sep 17 00:00:00 2001 From: Jinhyung Choi Date: Wed, 29 Mar 2017 14:48:46 +0900 Subject: [PATCH 01/16] package: update version (3.0.19) Change-Id: I996b447fb2a38c029c049ffd23f92230ee7f75fc Signed-off-by: Jinhyung Choi --- packaging/sdbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 824e475..5ec9380 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.18 +Version: 3.0.19 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4 From 98b721d34dc79807065f419cb8b4ebb390b4347b Mon Sep 17 00:00:00 2001 From: "hk57.kim" Date: Wed, 29 Mar 2017 09:51:20 +0900 Subject: [PATCH 02/16] [Tizen] Remove emulator build dependencies - This is for Tizen 4.0. - Added backward-compatibility that does not deteriorate 4.0 Configurability - When you SR this, you need to create JIRA-TRE issue of: : add sdbd-extension-emulator for common/mobile/wearable/ivi emulator : add sdbd-extension-tv-emulator for tv emulator (It's add, not replace.) Change-Id: Ifc620fd9d83d7a8d56241064832768697c08b058 Signed-off-by: hk57.kim --- CMakeLists.txt | 6 ------ packaging/sdbd.spec | 60 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64c56f9..e06a26d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,12 +96,6 @@ IF (_ARM_TARGET) ADD_DEFINITIONS("-DANDROID_GADGET=1") ENDIF (_ARM_TARGET) -IF(TARGET_ARCH STREQUAL x86) - ADD_DEFINITIONS("-DTARGET_ARCH_X86") -ELSE() - ADD_DEFINITIONS("-DTARGET_ARCH_ARM") -ENDIF() - IF(WEARABLE_PROFILE STREQUAL on) ADD_DEFINITIONS("-D_WEARABLE") ENDIF() diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 1b4eafc..0db14fa 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -42,6 +42,20 @@ Requires: %{name} = %{version}-%{release} SDB daemon extension for TV. This changes the service unit files of the default SDB daemon service files. +%ifarch %{ix86} x86_64 +%package extension-emulator +Summary: SDB daemon for emulator +Requires: %{name} = %{version}-%{release} +%description extension-emulator +SDB daemon for emulator + +%package extension-tv-emulator +Summary: SDB daemon for tv emulator +Requires: %{name}-profile_tv = %{version}-%{release} +%description extension-tv-emulator +SDB daemon for tv emulator +%endif // ifarch %{ix86} x86_64 + %package -n sdbd-devel Summary: SDBD plugin API Group: Development/Libraries @@ -55,32 +69,25 @@ cp %{SOURCE1003} . %build -# DO YOU REALLY SURE THAT x86 is never going to be non-emulator? -%if %{with emulator} -%define target_arch x86 -%else -%define target_arch arm -%endif - cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DTARGET_ARCH=%{target_arch} make %{?jobs:-j%jobs} %install mkdir -p %{buildroot}/usr/share/license cp LICENSE %{buildroot}/usr/share/license/%{name} - -%make_install mkdir -p %{buildroot}%{_unitdir} -%if %{with emulator} -install -m 0644 %SOURCE1006 %{buildroot}%{_unitdir}/sdbd.service.tv -install -m 0644 %SOURCE1002 %{buildroot}%{_unitdir}/sdbd.service +# extension-*-emulator +%ifarch %{ix86} x86_64 +install -m 0644 %SOURCE1006 %{buildroot}%{_unitdir}/sdbd.service.tv.emulator +install -m 0644 %SOURCE1002 %{buildroot}%{_unitdir}/sdbd.service.emulator mkdir -p %{buildroot}/%{_unitdir}/emulator_preinit.target.wants ln -s %{_unitdir}/sdbd.service %{buildroot}/%{_unitdir}/emulator_preinit.target.wants/ +%endif // ifarch %{ix86} x86_64 + +%make_install -%else install -m 0644 %SOURCE1005 %{buildroot}%{_unitdir}/sdbd.service.tv install -m 0644 %SOURCE1001 %{buildroot}%{_unitdir}/sdbd.service install -m 0644 %SOURCE1004 %{buildroot}%{_unitdir}/sdbd_tcp.service @@ -89,7 +96,6 @@ ln -s %{_unitdir}/sdbd.service %{buildroot}/%{_unitdir}/multi-user.target.wants/ mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d/ install -m 644 rules/99-sdbd.rules %{buildroot}%{_prefix}/lib/udev/rules.d/ -%endif mkdir -p %{buildroot}%{_prefix}/sbin install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/ @@ -126,16 +132,32 @@ chsmack -e "User::Shell" /sbin/sdbd-user %{_prefix}/sbin/sdk_launch %attr(0755, root, root) %{_sysconfdir}/init.d/sdbd %{_unitdir}/sdbd.service -%if %{with emulator} -%{_unitdir}/emulator_preinit.target.wants/sdbd.service -%else %{_unitdir}/sdbd_tcp.service %{_unitdir}/multi-user.target.wants/sdbd.service %{_prefix}/lib/udev/rules.d/99-sdbd.rules -%endif /usr/share/license/%{name} %{TZ_SYS_BIN}/profile_command +%ifarch %{ix86} x86_64 +%post extension-emulator +mv %{_unitdir}/sdbd.service.emulator %{_unitdir}/sdbd.service +%preun extension-emulator +mv %{_unitdir}/sdbd.service %{_unitdir}/sdbd.service.emulator +%files extension-emulator +%manifest sdbd.manifest +%{_unitdir}/sdbd.service.emulator +%{_unitdir}/emulator_preinit.target.wants/sdbd.service + +%post extension-tv-emulator +mv %{_unitdir}/sdbd.service.tv.emulator %{_unitdir}/sdbd.service +%preun extension-tv-emulator +mv %{_unitdir}/sdbd.service %{_unitdir}/sdbd.service.tv.emulator +%files extension-tv-emulator +%manifest sdbd.manifest +%{_unitdir}/sdbd.service.tv.emulator +%{_unitdir}/emulator_preinit.target.wants/sdbd.service +%endif // ifarch %{ix86} x86_64 + %post profile_tv pushd {%_unitdir} mv sdbd.service.tv sdbd.service -- 2.7.4 From a44cef0fb0f9a76708efd266fe8b91a253834742 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Tue, 4 Apr 2017 23:53:54 +0900 Subject: [PATCH 03/16] plugin: trivial modification of log contents 'out.array_of_parameter[0].v_int32' will freed by release function and 'success' can present the result enough. Change-Id: I072db5c7a1f078e7ca4e5d7ce4b99e1d6fdd397c Signed-off-by: Sooyoung Ha --- src/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin.c b/src/plugin.c index 68a02c6..394c863 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -311,7 +311,7 @@ int request_validity_to_plugin ( int cmd, const char* in_buf ) success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_VALID ) ? 1 : 0; release_parameters ( &out ); - D ("request validity success : %d\n", out.array_of_parameter[0].v_int32); + D ("request validity success : %d\n", success); } release_parameters ( &in ); -- 2.7.4 From 9e4d85986ad3f6b4702a429641de88beaf636f06 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Tue, 11 Apr 2017 18:27:33 +0900 Subject: [PATCH 04/16] subprocess.c: do not wait child process A redundant wait() action could occur the process-hang. Change-Id: I6e6d228d28a6d30e2f725a1cd8dadcad069edd7a Signed-off-by: Sooyoung Ha --- src/subprocess.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/subprocess.c b/src/subprocess.c index 71d8e16..6eb3ca0 100644 --- a/src/subprocess.c +++ b/src/subprocess.c @@ -183,21 +183,6 @@ socket_fail: free(sockpath); /* socket end */ - /* simply wait child */ - int status, ret; - ret = wait(&status); - fprintf(stderr, "sdbu pid %d has ", ret); - if (WIFEXITED(status)) { - fprintf(stderr, "terminated normally %d.\n", WEXITSTATUS(status)); - } else if (WIFSIGNALED(status)) { - fprintf(stderr, "signaled %d.\n", WTERMSIG(status)); - } else if (WIFSTOPPED(status)) { - fprintf(stderr, "stopped.\n"); - } else if (WIFCONTINUED(status)) { - fprintf(stderr, "continued.\n"); - } else { - fprintf(stderr, "terminated abnormally.\n"); - } return 0; } } -- 2.7.4 From c9320ee592c7a23a78c0c7c4423a39a9fbbfd050 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Tue, 11 Apr 2017 21:36:43 +0900 Subject: [PATCH 05/16] package: update version (3.0.20) Change-Id: I30d2d74a50d4697d7c002a3748cd4f27a4108bd8 Signed-off-by: Sooyoung Ha --- packaging/sdbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 0db14fa..ac5f44f 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.19 +Version: 3.0.20 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4 From fdc99470f0cfc3925cf1d1709bf20c8670ec8429 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Wed, 12 Apr 2017 00:06:54 +0900 Subject: [PATCH 06/16] fork: child process should call exit() Change-Id: I81ef43a5f54152e7f1d4f9480cd9b8220be794f2 Signed-off-by: Sooyoung Ha --- src/file_sync_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_sync_service.c b/src/file_sync_service.c index b2c2f4c..8b0b73c 100644 --- a/src/file_sync_service.c +++ b/src/file_sync_service.c @@ -582,7 +582,7 @@ void file_sync_service(int fd, void *cookie) if (pid == 0) { sdb_close(s[0]); //close the parent fd sync_read_label_notify(s[1]); - return; + _exit(0); } else if (pid > 0) { sdb_close(s[1]); -- 2.7.4 From fc5348227888e54fd4999bc4e22a6c14c5c8a8c2 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Wed, 12 Apr 2017 00:14:50 +0900 Subject: [PATCH 07/16] package: update version (3.0.21) Change-Id: Iab27716caef546f4b0fd3382828dfb8b87d26b0f Signed-off-by: Sooyoung Ha --- packaging/sdbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index ac5f44f..cb64740 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.20 +Version: 3.0.21 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4 From 317db5e54e8b2c16b8ccd85b2f55369876bbe2b5 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Thu, 13 Apr 2017 02:02:20 +0900 Subject: [PATCH 08/16] file_sync_service: fix stack corruption Change-Id: I1e85ba0bc7f772e8f8446030ea4ea71cda2b48d5 Signed-off-by: Sooyoung Ha --- src/file_sync_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_sync_service.c b/src/file_sync_service.c index 8b0b73c..d4d35eb 100644 --- a/src/file_sync_service.c +++ b/src/file_sync_service.c @@ -220,7 +220,7 @@ static int do_list(int s, const char *path) continue; } - s_strncpy(fname, de->d_name, sizeof tmp); + s_strncpy(fname, de->d_name, len); if(lstat(tmp, &st) == 0) { msg.dent.mode = htoll(st.st_mode); msg.dent.size = htoll(st.st_size); -- 2.7.4 From 5f8698b41647756d5a4386c704f0d446217d1fd7 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Thu, 13 Apr 2017 02:11:45 +0900 Subject: [PATCH 09/16] package: update version (3.0.22) Change-Id: I687caf67d1d79df25e096dd6d2365f2b2d16a057 Signed-off-by: Sooyoung Ha --- packaging/sdbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index cb64740..f5830f5 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.21 +Version: 3.0.22 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4 From 9f8960351494588c5a41b8ef100c890e620864ea Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Thu, 13 Apr 2017 15:30:30 +0900 Subject: [PATCH 10/16] packaging: remove redundant file copy code Change-Id: I9964684b1de3bd44cad0b85c356eea69c4abd1d6 Signed-off-by: Sooyoung Ha --- packaging/sdbd.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index f5830f5..d353b13 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -74,8 +74,6 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ make %{?jobs:-j%jobs} %install -mkdir -p %{buildroot}/usr/share/license -cp LICENSE %{buildroot}/usr/share/license/%{name} mkdir -p %{buildroot}%{_unitdir} # extension-*-emulator @@ -135,7 +133,6 @@ chsmack -e "User::Shell" /sbin/sdbd-user %{_unitdir}/sdbd_tcp.service %{_unitdir}/multi-user.target.wants/sdbd.service %{_prefix}/lib/udev/rules.d/99-sdbd.rules -/usr/share/license/%{name} %{TZ_SYS_BIN}/profile_command %ifarch %{ix86} x86_64 -- 2.7.4 From ab7e3e8750f26c4a9b538762d7764ff3fecae20e Mon Sep 17 00:00:00 2001 From: Munkyu Im Date: Tue, 11 Apr 2017 23:34:35 +0900 Subject: [PATCH 11/16] misc: avoid potential buffer overflows Change-Id: I9c0c8c389cb502719d531a8495f4e35539606ffa Signed-off-by: Munkyu Im (cherry picked from commit 31061870b2693168025f6d6717c1ea8e8ae8c3e6) --- src/default_plugin_appcmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/default_plugin_appcmd.c b/src/default_plugin_appcmd.c index 643fb77..62a0217 100644 --- a/src/default_plugin_appcmd.c +++ b/src/default_plugin_appcmd.c @@ -300,7 +300,7 @@ static void appcmd_receiver_debugwebapp(int fd_in, int fd_out) D("debug webapp output : %s\n", buf); sub_str = strstr(buf, "port: "); - if (sub_str != NULL && sscanf(sub_str, "port: %s", port_str) == 1) { + if (sub_str != NULL && sscanf(sub_str, "port: %31s", port_str) == 1) { snprintf(out_buf, sizeof(out_buf), "\n%s:%s\n", MESSAGE_PREFIX_APPCMD_RETURN, port_str); writex(fd_out, out_buf, strlen(out_buf)+1); break; @@ -411,13 +411,13 @@ static void appcmd_receiver_appinfo(int fd_in, int fd_out) if (!strncmp(buf, "Appid: ", 7)) { memset(appid, 0, sizeof(appid)); - sscanf(buf, "Appid: %s", appid); + sscanf(buf, "Appid: %127s", appid); snprintf(out_buf+out_ptr, sizeof(out_buf)-out_ptr, ":%s", appid); out_ptr += strlen(appid)+1; } else if (!strncmp(buf, "Apptype: ", 9)) { memset(apptype, 0, sizeof(apptype)); - sscanf(buf, "Apptype: %s", apptype); + sscanf(buf, "Apptype: %127s", apptype); snprintf(out_buf+out_ptr, sizeof(out_buf)-out_ptr, ":%s", apptype); out_ptr += strlen(apptype)+1; -- 2.7.4 From dfb2d193c82a54bbb9647be30be03b49586061c5 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Thu, 20 Apr 2017 20:28:00 +0900 Subject: [PATCH 12/16] package: update version (3.0.23) Change-Id: I2ed26fbaf8c2fa13936e1a7efb9a0b1c263ca63b Signed-off-by: Sooyoung Ha --- packaging/sdbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index d353b13..e594ed7 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.22 +Version: 3.0.23 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4 From 59ee84abdf93edd551fd2c274bdf53ada93310ad Mon Sep 17 00:00:00 2001 From: Munkyu Im Date: Mon, 24 Apr 2017 18:20:57 +0900 Subject: [PATCH 13/16] sync: fix excluded files issue when execute "sdb pull" command need 1 length more to handle null terminated. Change-Id: I0da67c726cc2b68d636faac42c46c860c2ec892b Signed-off-by: Munkyu Im --- src/file_sync_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_sync_service.c b/src/file_sync_service.c index d4d35eb..f2da4c1 100644 --- a/src/file_sync_service.c +++ b/src/file_sync_service.c @@ -220,7 +220,7 @@ static int do_list(int s, const char *path) continue; } - s_strncpy(fname, de->d_name, len); + s_strncpy(fname, de->d_name, len + 1); if(lstat(tmp, &st) == 0) { msg.dent.mode = htoll(st.st_mode); msg.dent.size = htoll(st.st_size); -- 2.7.4 From e6c3665bd4b4b73706b5a6e3ab7d7e0a1b52b82f Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Mon, 24 Apr 2017 23:31:23 +0900 Subject: [PATCH 14/16] package: update version (3.0.24) Change-Id: I17e56843a94725176eee0982414e7f2435ed4795 Signed-off-by: Sooyoung Ha --- packaging/sdbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index e594ed7..16f2830 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.23 +Version: 3.0.24 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4 From 4ac7e0127bc9ee267835430b26bfd887cf386e26 Mon Sep 17 00:00:00 2001 From: Jinhyung Choi Date: Thu, 20 Apr 2017 15:08:44 +0900 Subject: [PATCH 15/16] misc: avoid potential buffer overflow Change-Id: Ib87bfb9ee6a3f1a0b3b3cd3d65f460e0ceea3338 Signed-off-by: Jinhyung Choi (cherry picked from commit efe0ed6319e6f273dd78aadcac445a99524691ba) --- src/sdktools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdktools.c b/src/sdktools.c index ac7d21e..755625a 100644 --- a/src/sdktools.c +++ b/src/sdktools.c @@ -90,7 +90,7 @@ static int get_application_install_path(char* pkg_path) { while(ret_str[--len]=='\n'); ret_str[len + 1] = '\0'; - if (sscanf(ret_str, "Tizen Application Installation Path: %s", pkg_path) != 1) { + if (sscanf(ret_str, "Tizen Application Installation Path: %4095s", pkg_path) != 1) { D("failed : parsing fail (str:%s)\n", ret_str); return 0; } -- 2.7.4 From d2d4514fb32cc7dca021ac4162d0dc22b09e6c13 Mon Sep 17 00:00:00 2001 From: Jinhyung Choi Date: Wed, 10 May 2017 14:04:37 +0900 Subject: [PATCH 16/16] package: update version (3.0.25) Change-Id: I40f480f3279054c663d46c0bc2f5507ff4e549c2 Signed-off-by: Jinhyung Choi --- packaging/sdbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 16f2830..fe45995 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.24 +Version: 3.0.25 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4