From 5eccd4893aedf06f8cb88dd0e1902a53baf665fe Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Wed, 7 Sep 2022 17:25:22 -0400 Subject: [PATCH] Set FD_CLOEXEC on scriptd(Sock|Stream). These have no reason to be inherited by the script when it is run by posix_spawn(). --- scriptd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scriptd.c b/scriptd.c index cdfa717..ce8ebdb 100644 --- a/scriptd.c +++ b/scriptd.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "nk/log.h" #include "nk/io.h" #include "nk/pspawn.h" @@ -153,6 +154,8 @@ void scriptd_main(void) prctl(PR_SET_NAME, "ndhc: scriptd"); umask(077); setup_signals_scriptd(); + fcntl(scriptdSock[1], F_SETFD, FD_CLOEXEC); + fcntl(scriptdStream[1], F_SETFD, FD_CLOEXEC); do_scriptd_work(); }