commit fec92363bac6e6e2ebe50e90b4078f6fc9554c6e
parent 13f780ac4cd637b890a3c9799176f51a0e71ea45
Author: David Goulet <dgoulet@torproject.org>
Date: Mon, 4 Aug 2025 19:38:47 +0000
Merge branch 'unix-processes/cloexec-pipes' into 'main'
Unix processes / IPC / Utilize pipes with "close-on-exec" flag set
See merge request tpo/core/tor!916
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/lib/process/process_unix.c b/src/lib/process/process_unix.c
@@ -49,6 +49,8 @@
#ifndef _WIN32
+#include "lib/fdio/fdio.h"
+
/** Internal state for Unix handles. */
struct process_unix_handle_t {
/** Unix File Descriptor. */
@@ -137,7 +139,7 @@ process_unix_exec(process_t *process)
unix_process = process_get_unix_process(process);
/* Create standard in pipe. */
- retval = pipe(stdin_pipe);
+ retval = tor_pipe_cloexec(stdin_pipe);
if (-1 == retval) {
log_warn(LD_PROCESS,
@@ -149,7 +151,7 @@ process_unix_exec(process_t *process)
}
/* Create standard out pipe. */
- retval = pipe(stdout_pipe);
+ retval = tor_pipe_cloexec(stdout_pipe);
if (-1 == retval) {
log_warn(LD_PROCESS,
@@ -165,7 +167,7 @@ process_unix_exec(process_t *process)
}
/* Create standard error pipe. */
- retval = pipe(stderr_pipe);
+ retval = tor_pipe_cloexec(stderr_pipe);
if (-1 == retval) {
log_warn(LD_PROCESS,