From e0169d38f3258026f6cc498aff4080764bd16c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 2 Nov 2020 19:13:11 +0100 Subject: [PATCH] =?UTF-8?q?module/script:=20don=E2=80=99t=20re-direct=20st?= =?UTF-8?q?derr=20to=20/dev/null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/script.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/script.c b/modules/script.c index e18570e..a904387 100644 --- a/modules/script.c +++ b/modules/script.c @@ -463,13 +463,12 @@ run(struct module *mod) close(exec_pipe[0]); close(comm_pipe[0]); - /* Re-direct stdin/stdout/stderr */ - int dev_null = open("/dev/null", O_RDWR); + /* Re-direct stdin/stdout */ + int dev_null = open("/dev/null", O_RDONLY); if (dev_null < 0) goto fail; if (dup2(dev_null, STDIN_FILENO) < 0 || - dup2(dev_null, STDERR_FILENO) < 0 || dup2(comm_pipe[1], STDOUT_FILENO) < 0) { goto fail;