aboutsummaryrefslogtreecommitdiff
path: root/src/lib/process/include.am
AgeCommit message (Collapse)Author
2020-02-24Move winprocess_sys into a new low-level hardening moduleNick Mathewson
This code was in our process module, but it doesn't belong there: process is for launching and monitoring subprocesses, not for hardening the current process. This change lets us have our subsystem init order more closely match our dependency order.
2019-05-02Add comments to include.am files to note where new sources goNick Mathewson
This mechanism isn't perfect, and sometimes it will guess wrong, but it will help our automation.
2018-12-21Use the subsystem list to initialize and shutdown process module.Alexander Færøy
This patch makes the process module use the subsystem list for initializing and shutting down. See: https://bugs.torproject.org/28847
2018-12-17Move remaining code from subprocess.{h,c} to more appropriate places.Alexander Færøy
This patch moves the remaining code from subprocess.{h,c} to more appropriate places in the process.c and process_win32.c module. We also delete the now empty subprocess module files. See: https://bugs.torproject.org/28179
2018-12-17Add Windows backend for the Process subsystem.Alexander Færøy
This patch adds support for Microsoft Windows in the Process subsystem. Libevent does not support mixing different types of handles (sockets, named pipes, etc.) on Windows in its core event loop code. This have historically meant that Tor have avoided attaching any non-networking handles to the event loop. This patch uses a slightly different approach to roughly support the same features for the Process subsystem as we do with the Unix backend. In this patch we use Windows Extended I/O functions (ReadFileEx() and WriteFileEx()) which executes asynchronously in the background and executes a completion routine when the scheduled read or write operation have completed. This is much different from the Unix backend where the operating system signals to us whenever a file descriptor is "ready" to either being read from or written to. To make the Windows operating system execute the completion routines of ReadFileEx() and WriteFileEx() we must get the Tor process into what Microsoft calls an "alertable" state. To do this we execute SleepEx() with a zero millisecond sleep time from a main loop timer that ticks once a second. This moves the process into the "alertable" state and when we return from the zero millisecond timeout all the outstanding I/O completion routines will be called and we can schedule the next reads and writes. The timer loop is also responsible for detecting whether our child processes have terminated since the last timer tick. See: https://bugs.torproject.org/28179
2018-12-17Add Unix backend for the Process subsystem.Alexander Færøy
This patch adds the Unix backend for the Process subsystem. The Unix backend attaches file descriptors from the child process's standard in, out and error to Tor's libevent based main loop using traditional Unix pipes. We use the already available `waitpid` module to get events whenever the child process terminates. See: https://bugs.torproject.org/28179
2018-12-17Add new Process subsystem.Alexander Færøy
This patch adds a new Process subsystem for running external programs in the background of Tor. The design is focused around a new type named `process_t` which have an API that allows the developer to easily write code that interacts with the given child process. These interactions includes: - Easy API for writing output to the child process's standard input handle. - Receive callbacks whenever the child has output on either its standard output or standard error handles. - Receive callback when the child process terminates. We also support two different "protocols" for handling output from the child process. The default protocol is the "line" protocol where the process output callbacks will be invoked only when there is complete lines (either "\r\n" or "\n" terminated). We also support the "raw" protocol where the read callbacks will get whatever the operating system delivered to us in a single read operation. This patch does not include any operating system backends, but the Unix and Windows backends will be included in separate commits. See: https://bugs.torproject.org/28179
2018-11-05Make the windows process parameter initialization a subsystemNick Mathewson
Also, move it from "main" into lib/process
2018-06-28Extract process-management functionality into a new lib/processNick Mathewson
Note that procmon does *not* go here, since procmon needs to integrate with the event loop.