]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
start_daemon: open pipe with cloexec
authorJim Newsome <jnewsome@torproject.org>
Mon, 2 Jun 2025 22:10:45 +0000 (17:10 -0500)
committerJim Newsome <jnewsome@torproject.org>
Tue, 3 Jun 2025 15:26:51 +0000 (10:26 -0500)
Fixes #41013
Fixes #41088

changes/bug41088 [new file with mode: 0644]
src/lib/process/.may_include
src/lib/process/daemon.c

diff --git a/changes/bug41088 b/changes/bug41088
new file mode 100644 (file)
index 0000000..7f9c178
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (bridges, pluggable transport):
+    - Fix a bug causing the initial tor process to hang intead of exiting with
+      RunAsDaemon, when pluggable transports are used.
+      Fixes bug 41088; bugfix on 0.4.9.1-alpha.
index ce1b6ecf5979c8a291c8a407764674fae5a4145d..0254cc6027bf6700aac71beb84e37f3dbae84f9e 100644 (file)
@@ -6,6 +6,7 @@ lib/container/*.h
 lib/ctime/*.h
 lib/err/*.h
 lib/evloop/*.h
+lib/fdio/*.h
 lib/fs/*.h
 lib/intmath/*.h
 lib/log/*.h
index abd1d36576240d19d96478f6b1d1f065bff4ffb8..1bfb162d85f8a8d72724fa621787b1ce90694f35 100644 (file)
@@ -13,6 +13,7 @@
 
 #ifndef _WIN32
 
+#include "lib/fdio/fdio.h"
 #include "lib/fs/files.h"
 #include "lib/log/log.h"
 #include "lib/thread/threads.h"
@@ -63,7 +64,7 @@ start_daemon(void)
     return 0;
   start_daemon_called = 1;
 
-  if (pipe(daemon_filedes)) {
+  if (tor_pipe_cloexec(daemon_filedes)) {
     /* LCOV_EXCL_START */
     log_err(LD_GENERAL,"pipe failed; exiting. Error was %s", strerror(errno));
     exit(1); // exit ok: during daemonize, pipe failed.