aboutsummaryrefslogtreecommitdiff
path: root/src/lib/process
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2019-03-25 03:00:53 +0100
committerAlexander Færøy <ahf@torproject.org>2019-03-25 03:10:37 +0100
commit4be522b2e6eb634b141d7876234acf40a931cab6 (patch)
tree68de7c78b1996cee77e43df9a6f96a092c63a6ba /src/lib/process
parent8bc3ac6a84a11adb728f4ce49f23414c27fe84cd (diff)
downloadtor-4be522b2e6eb634b141d7876234acf40a931cab6.tar.gz
tor-4be522b2e6eb634b141d7876234acf40a931cab6.zip
Pass NULL to lpApplicationName in CreateProcessA().
When NULL is given to lpApplicationName we enable Windows' "magical" path interpretation logic, which makes Tor 0.4.x behave in the same way as previous Tor versions did when it comes to executing binaries in different system paths. For more information about this have a look at the CreateProcessA() documentation on MSDN -- especially the string interpretation example is useful to understand this issue. This bug was introduced in commit bfb94dd2ca8. See: https://bugs.torproject.org/29874
Diffstat (limited to 'src/lib/process')
-rw-r--r--src/lib/process/process_win32.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index 21d0b23476..ddbe76bfd9 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -152,11 +152,6 @@ process_win32_exec(process_t *process)
HANDLE stdin_pipe_read = NULL;
HANDLE stdin_pipe_write = NULL;
BOOL ret = FALSE;
- const char *filename = process_get_command(process);
-
- /* Not much we can do if we haven't been told what to start. */
- if (BUG(filename == NULL))
- return PROCESS_STATUS_ERROR;
/* Setup our security attributes. */
SECURITY_ATTRIBUTES security_attributes;
@@ -211,7 +206,7 @@ process_win32_exec(process_t *process)
char *joined_argv = tor_join_win_cmdline((const char **)argv);
/* Create the child process */
- ret = CreateProcessA(filename,
+ ret = CreateProcessA(NULL,
joined_argv,
NULL,
NULL,