summaryrefslogtreecommitdiffstats
path: root/src/shell.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-30 02:45:01 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-30 02:45:01 +0200
commit36f9d70182c4c2f2e617192ae34abd6c44549a78 (patch)
treebcc78e6b4cd4c24e0e702855bf8e87605490fcdd /src/shell.c
parent9a86ce6ea990ac72337bffb78f663f8a904a408f (diff)
downloadfastd-36f9d70182c4c2f2e617192ae34abd6c44549a78.tar
fastd-36f9d70182c4c2f2e617192ae34abd6c44549a78.zip
shell: close all fds > 2 after forking
socket/fcntl to set FD_CLOEXEC isn't thread-safe with async verify handlers, and SOCK_CLOEXEC isn't portable.
Diffstat (limited to 'src/shell.c')
-rw-r--r--src/shell.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shell.c b/src/shell.c
index 3b2644b..9d03fbc 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -120,6 +120,8 @@ static bool shell_command_do_exec(const fastd_shell_command_t *command, const fa
/* child process */
+ fastd_close_all_fds();
+
if (chdir(command->dir))
_exit(126);