]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Pass NULL to lpApplicationName in CreateProcessA().
authorAlexander Færøy <ahf@torproject.org>
Mon, 25 Mar 2019 02:00:53 +0000 (03:00 +0100)
committerAlexander Færøy <ahf@torproject.org>
Mon, 25 Mar 2019 02:10:37 +0000 (03:10 +0100)
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

changes/bug29874 [new file with mode: 0644]
src/lib/process/process_win32.c

diff --git a/changes/bug29874 b/changes/bug29874
new file mode 100644 (file)
index 0000000..8534753
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (pluggable transports):
+    - Restore old behaviour when it comes to discovering the path of a given
+      Pluggable Transport exe-file. Fixes bug 29874; bugfix on 0.4.0.1-alpha.
+
index 21d0b234769a12180208b4f33372177b1e8fb51f..ddbe76bfd9ba3c27bc142c7b3113b4cce48f55d7 100644 (file)
@@ -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,