From d4c410f99a3e95478727a50e9d78d1b66cb57c19 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 18 Apr 2014 16:54:32 +0200 Subject: shell: unblock SIGCHLD before exec --- src/shell.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/shell.c b/src/shell.c index 8690a1f..23381e0 100644 --- a/src/shell.c +++ b/src/shell.c @@ -141,11 +141,18 @@ static bool shell_command_do_exec(fastd_context_t *ctx, const fastd_shell_comman } /* child process */ + if (chdir(command->dir)) _exit(126); shell_command_setenv(ctx, parent, peer, local_addr, peer_addr); + /* unblock SIGCHLD */ + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGCHLD); + pthread_sigmask(SIG_UNBLOCK, &set, NULL); + execl("/bin/sh", "sh", "-c", command->command, (char*)NULL); _exit(127); } -- cgit v1.2.3