From: Jinhyung Choi Date: Thu, 23 Mar 2017 06:46:20 +0000 (+0900) Subject: subprocess: remove user shell X-Git-Tag: accepted/tizen/3.0/common/20170328.141912~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F120516%2F1;p=sdk%2Ftarget%2Fsdbd.git subprocess: remove user shell sub-process uses /sh instead of a copy of it. Change-Id: I2f0eb13fe5f08ae4eb6b1f3e57fd6d4119d7e446 Signed-off-by: Jinhyung Choi --- 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 */