aboutsummaryrefslogtreecommitdiff
path: root/src/lib/err
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-09-04 15:38:58 +1000
committerteor <teor@torproject.org>2019-09-09 14:56:28 +1000
commita22fbab98690f802ae3bda276078cc7fc767feba (patch)
treee6624fc08796d4da73c39be845cc4d1ef5847c13 /src/lib/err
parentd02ced4cafaed5b11079585f03f47e73034dd980 (diff)
downloadtor-a22fbab98690f802ae3bda276078cc7fc767feba.tar.gz
tor-a22fbab98690f802ae3bda276078cc7fc767feba.zip
log: Don't close file log fds that are being used by the err module
Instead, dup() file log fds, before passing them to the err module. Closes 31613, part of 31594.
Diffstat (limited to 'src/lib/err')
-rw-r--r--src/lib/err/torerr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/err/torerr.c b/src/lib/err/torerr.c
index 2c4a10a5bb..f460fd8379 100644
--- a/src/lib/err/torerr.c
+++ b/src/lib/err/torerr.c
@@ -111,6 +111,12 @@ tor_log_get_sigsafe_err_fds(const int **out)
* other emergency condition. Ignore any beyond the first
* TOR_SIGSAFE_LOG_MAX_FDS.
*
+ * These fds must remain open even after the log module has shut down. (And
+ * they should remain open even while logs are being reconfigured.) Therefore,
+ * any fds closed by the log module should be dup()ed, and the duplicate fd
+ * should be given to the err module in fds. In particular, the log module
+ * closes the file log fds, but does not close the stdio log fds.
+ *
* If fds is NULL or n is 0, clears the list of error fds.
*/
void