From 5ed9c5e515140d3818d29ee3b4854e715d21d320 Mon Sep 17 00:00:00 2001 From: Jinhyung Choi Date: Thu, 23 Mar 2017 15:46:20 +0900 Subject: [PATCH 01/16] subprocess: remove user shell sub-process uses /sh instead of a copy of it. Change-Id: I2f0eb13fe5f08ae4eb6b1f3e57fd6d4119d7e446 Signed-off-by: Jinhyung Choi --- packaging/sdbd.spec | 3 --- src/subprocess.c | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index c0f2137..7f6c4aa 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -112,9 +112,6 @@ if ! getent passwd "${TZ_SDK_USER_NAME}" > /dev/null; then done fi -cp -f /bin/sh /bin/sh-user -chsmack -a "_" /bin/sh-user -chsmack -e "User::Shell" /bin/sh-user chsmack -a "_" /sbin/sdbd-user chsmack -e "User::Shell" /sbin/sdbd-user diff --git a/src/subprocess.c b/src/subprocess.c index 24676a1..71d8e16 100644 --- a/src/subprocess.c +++ b/src/subprocess.c @@ -27,7 +27,7 @@ #include "sysdeps.h" #include "sdb.h" -#define SHELL_COMMAND "/bin/sh-user" +#define SHELL_COMMAND "/bin/sh" /* to send ptm fd to sdbd main */ static ssize_t send_fd(int fd, void *ptr, size_t nbytes, int sendfd) @@ -100,7 +100,7 @@ int main (int argc, char **argv, char **envp) } /* sdbd-user's child. - This just open pts and exec sh-user */ + This just open pts and exec sh */ if (pid == 0) { int pts; setsid(); @@ -126,7 +126,6 @@ int main (int argc, char **argv, char **envp) } } - /* argv[0] should be /bin/sh-user. original data is /usr/sbin/sdbd-user */ argv[0] = SHELL_COMMAND; redirect_and_exec(pts, SHELL_COMMAND, argv, envp); /* if exec error */ -- 2.7.4 From 22e59566403f3da5524919324b763df724b53ebb Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Sat, 25 Mar 2017 00:46:21 +0900 Subject: [PATCH 02/16] service: change method of create_process function On some case, System privileged shell is needed(ex: appcmd). I provide functions for creating System privileged process as create_subprocess() and create_userprocess() for User::Shell privileged. And I also clarify the equivocal definition name. Change-Id: Iac129b81e2534ec2a54dc29969098ca8014f582c Signed-off-by: Sooyoung Ha --- src/services.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 102 insertions(+), 8 deletions(-) diff --git a/src/services.c b/src/services.c index f6c1df6..1daaa43 100644 --- a/src/services.c +++ b/src/services.c @@ -371,6 +371,100 @@ static int create_service_thread(void (*func)(int, void *), void *cookie) } #if !SDB_HOST + +static void redirect_and_exec(int pts, const char *cmd, char * const argv[], char * const envp[]) +{ + dup2(pts, 0); + dup2(pts, 1); + dup2(pts, 2); + + sdb_close(pts); + + execve(cmd, argv, envp); +} + +int create_subprocess(const char *cmd, pid_t *pid, char * const argv[], char * const envp[]) +{ + char devname[64]; + int ptm; + + ptm = unix_open("/dev/ptmx", O_RDWR); // | O_NOCTTY); + if(ptm < 0){ + D("[ cannot open /dev/ptmx - errno:%d ]\n",errno); + return -1; + } + if (fcntl(ptm, F_SETFD, FD_CLOEXEC) < 0) { + D("[ cannot set cloexec to /dev/ptmx - errno:%d ]\n",errno); + } + + if(grantpt(ptm) || unlockpt(ptm) || + ptsname_r(ptm, devname, sizeof(devname)) != 0 ){ + D("[ trouble with /dev/ptmx - errno:%d ]\n", errno); + sdb_close(ptm); + return -1; + } + + *pid = fork(); + if(*pid < 0) { + D("- fork failed: errno:%d -\n", errno); + sdb_close(ptm); + return -1; + } + + if(*pid == 0){ + int pts; + + setsid(); + + pts = unix_open(devname, O_RDWR); + if(pts < 0) { + fprintf(stderr, "child failed to open pseudo-term slave: %s\n", devname); + exit(-1); + } + + sdb_close(ptm); + + // set OOM adjustment to zero + { + char text[64]; + //snprintf(text, sizeof text, "/proc/%d/oom_score_adj", getpid()); + snprintf(text, sizeof text, "/proc/%d/oom_adj", getpid()); + int fd = sdb_open(text, O_WRONLY); + if (fd >= 0) { + sdb_write(fd, "0", 1); + sdb_close(fd); + } else { + // FIXME: not supposed to be here + D("sdb: unable to open %s due to errno:%d\n", text, errno); + } + } + + if (should_drop_privileges()) { + if (argv[2] != NULL && request_validity_to_plugin(PLUGIN_SYNC_CMD_VERIFY_ROOTCMD, argv[2])) { + // do nothing + D("sdb: executes root commands!!:%s\n", argv[2]); + } else { + if (getuid() != g_sdk_user_id && set_sdk_user_privileges(RESERVE_CAPABILITIES_AFTER_FORK) < 0) { + fprintf(stderr, "failed to set SDK user privileges\n"); + exit(-1); + } + } + } else { + set_root_privileges(); + } + redirect_and_exec(pts, cmd, argv, envp); + fprintf(stderr, "- exec '%s' failed: (errno:%d) -\n", + cmd, errno); + exit(-1); + } else { + // Don't set child's OOM adjustment to zero. + // Let the child do it itself, as sometimes the parent starts + // running before the child has a /proc/pid/oom_adj. + // """sdb: unable to open /proc/644/oom_adj""" seen in some logs. + return ptm; + } +} + /* receive the ptm from child, sdbd-user */ static ssize_t recv_fd(int fd, void *ptr, size_t nbytes, int *recvfd) { @@ -416,7 +510,7 @@ static ssize_t recv_fd(int fd, void *ptr, size_t nbytes, int *recvfd) return ret; } -int create_subprocess(const char *cmd, pid_t *pid, char * const argv[], char * const envp[]) +int create_userprocess(const char *cmd, pid_t *pid, char * const argv[], char * const envp[]) { *pid = fork(); if(*pid < 0) { @@ -512,7 +606,7 @@ int create_subprocess(const char *cmd, pid_t *pid, char * const argv[], char * c } #endif /* !SDB_HOST */ -#define SHELL_COMMAND "/usr/sbin/sdbd-user" +#define USER_DAEMON_COMMAND "/usr/sbin/sdbd-user" #define LOGIN_COMMAND "/bin/login" #define SUPER_USER "root" #define LOGIN_CONFIG "/etc/login.defs" @@ -688,14 +782,14 @@ static int create_subproc_thread(const char *name, int lines, int columns) D("converted cmd : %s\n", new_cmd); char *args[] = { - SHELL_COMMAND, + USER_DAEMON_COMMAND, "-c", NULL, NULL, }; args[2] = new_cmd; - ret_fd = create_subprocess(SHELL_COMMAND, &pid, (char * const*)args, (char * const*)envp); + ret_fd = create_userprocess(USER_DAEMON_COMMAND, &pid, (char * const*)args, (char * const*)envp); free(new_cmd); } else { // in case of shell interactively // Check the capability for interactive shell support. @@ -705,19 +799,19 @@ static int create_subproc_thread(const char *name, int lines, int columns) } char * const args[] = { - SHELL_COMMAND, + USER_DAEMON_COMMAND, "-", NULL, }; - ret_fd = create_subprocess(SHELL_COMMAND, &pid, (char * const*)args, (char * const*)envp); + ret_fd = create_userprocess(USER_DAEMON_COMMAND, &pid, (char * const*)args, (char * const*)envp); #if 0 // FIXME: should call login command instead of /bin/sh if (should_drop_privileges()) { char *args[] = { - SHELL_COMMAND, + USER_DAEMON_COMMAND, "-", NULL, }; - ret_fd = create_subprocess(SHELL_COMMAND, &pid, args, envp); + ret_fd = create_userprocess(USER_DAEMON_COMMAND, &pid, args, envp); } else { char *args[] = { LOGIN_COMMAND, -- 2.7.4 From 0844f3b6cf15407b577f6d5653302d6af6fdf874 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Mon, 27 Mar 2017 15:03:08 +0900 Subject: [PATCH 03/16] package: update version (3.0.18) Change-Id: I43d8e8f049b7cb91838d4d48d52c91680a61b672 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 7f6c4aa..824e475 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.17 +Version: 3.0.18 Release: 0 License: Apache-2.0 Summary: SDB daemon -- 2.7.4 From 29ad9904acb9d6ec0885721e8aa59e3f13794d5f Mon Sep 17 00:00:00 2001 From: Jinhyung Choi Date: Wed, 29 Mar 2017 14:31:23 +0900 Subject: [PATCH 04/16] appcmd: modify runapp command for watchapp type Change-Id: If92e6400b7e88c33ee088fe551127778b962df2e Signed-off-by: Jinhyung Choi --- src/default_plugin_appcmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/default_plugin_appcmd.c b/src/default_plugin_appcmd.c index c929cf2..643fb77 100644 --- a/src/default_plugin_appcmd.c +++ b/src/default_plugin_appcmd.c @@ -128,7 +128,10 @@ static int appcmd_runapp_gen_shellcmd(appcmd_info* p_info) { D("args: appid=%s\n", appid); - snprintf(buf, len, "/usr/bin/app_launcher --start %s", appid); + snprintf(buf, len, "/usr/bin/pkginfo --app %s | grep component: | awk '{print $2}'" + " | while read var; do if [ $var = watchapp ]; then /usr/bin/app_launcher " + "--start org.tizen.widget_viewer_sdk widget_id %s; else /usr/bin/app_launcher " + "--start %s; fi; done", appid, appid, appid); return 0; } -- 2.7.4 From 12045bfedb7f8deaac7143fbf3a42e9188ecf538 Mon Sep 17 00:00:00 2001 From: Jinhyung Choi Date: Wed, 29 Mar 2017 14:48:46 +0900 Subject: [PATCH 05/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 06/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 07/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 08/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 09/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 10/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 11/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 12/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 13/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 14/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 15/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 16/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