From a0640fbfff65d0f9327f6e6bfadf40655f048136 Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Tue, 8 May 2018 13:01:31 -0400 Subject: [PATCH] Abort instead of exit from forked tids and mons subprocesses --- mon/mons.c | 6 +++++- tid/tids.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mon/mons.c b/mon/mons.c index b0a0400..cebe329 100644 --- a/mon/mons.c +++ b/mon/mons.c @@ -255,7 +255,11 @@ int mons_accept(MONS_INSTANCE *mons, int listen) break; } close(conn); - exit(0); /* exit to kill forked child process */ + + /* This ought to be an exit(0), but log4shib does not play well with our (mis)use of threads and + * fork() in the main process. Until we sort that out, we abort() to force termination of this + * process. */ + abort(); /* exit hard */ } /* Only the parent process gets here */ diff --git a/tid/tids.c b/tid/tids.c index 0569333..1a29620 100644 --- a/tid/tids.c +++ b/tid/tids.c @@ -442,7 +442,11 @@ static void tids_handle_proc(TIDS_INSTANCE *tids, int conn_fd, int result_fd) close(result_fd); close(conn_fd); - exit(0); /* exit to kill forked child process */ + + /* This ought to be an exit(0), but log4shib does not play well with our (mis)use of threads and + * fork() in the main process. Until we sort that out, we abort() to force termination of this + * process. */ + abort(); /* exit hard */ } /* Accept and process a connection on a port opened with tids_get_listener() */ -- 2.1.4