diff --git a/modules/script.c b/modules/script.c index da11a80..e18570e 100644 --- a/modules/script.c +++ b/modules/script.c @@ -479,6 +479,16 @@ run(struct module *mod) close(comm_pipe[1]); comm_pipe[1] = -1; + /* Close *all* other FDs */ + for (int i = STDERR_FILENO + 1; i < 65536; i++) { + if (i == exec_pipe[1]) { + /* Needed for error reporting. Automatically closed + * when execvp() succeeds */ + continue; + } + close(i); + } + execvp(m->path, argv); fail: