From bae5a08c9c96d720479020a514cdd453ac4256c4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 15 Aug 2022 17:22:15 +0100 Subject: [PATCH] prefork-interp: New protocol: C: Do not env-pass saves Signed-off-by: Ian Jackson --- cprogs/prefork-interp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cprogs/prefork-interp.c b/cprogs/prefork-interp.c index b15d61a..11f53d0 100644 --- a/cprogs/prefork-interp.c +++ b/cprogs/prefork-interp.c @@ -332,15 +332,12 @@ void become_setup(int sfd, int fake_pair[2]) { close(fake_pair[0]); int call_fd = fake_pair[1]; - int fd0_save = dup(0); if (fd0_save < 0) diee("dup stdin"); - int fd1_save = dup(1); if (fd1_save < 0) diee("dup stdin"); - int null_0 = open("/dev/null", O_RDONLY); if (null_0 < 0) diee("open null"); if (dup2(null_0, 0)) diee("dup2 /dev/null onto stdin"); if (dup2(2, 1) != 1) die("dup2 stderr onto stdout"); - putenv(m_asprintf("PREFORK_INTERP=%d,%d,%d,%d,%s", - sfd, call_fd, fd0_save, fd1_save, socket_path)); + putenv(m_asprintf("PREFORK_INTERP=%d,%d,%s", + sfd, call_fd, socket_path)); execvp(executor_argv[0], (char**)executor_argv); diee("execute %s", executor_argv[0]); -- 2.30.2