aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-11-14 11:15:02 +0000
committerRon Yorston <rmy@pobox.com>2023-11-14 11:15:02 +0000
commitf444dc586b16c104a82d201d3a7caca68affe51b (patch)
tree6e39b32ab1385f6a67d5a0ddf98c4b0d33d59148 /networking
parent5085fe5d56e63f23f9812bd120a8453bd6589edc (diff)
downloadbusybox-w32-f444dc586b16c104a82d201d3a7caca68affe51b.tar.gz
busybox-w32-f444dc586b16c104a82d201d3a7caca68affe51b.tar.bz2
busybox-w32-f444dc586b16c104a82d201d3a7caca68affe51b.zip
win32: only search PATH for compressor
mingw_fork_compressor() uses CreateProcess() to run the compressor program. This will often be an instance of BusyBox, but since the xv and lzma applets in BusyBox don't support compression it can be an external program. It was intended that the external program should be found using PATH. However, CreateProcess() looks in various other places before trying PATH. In particular, it first looks in the directory of the current executable, then in the current directory of the process. This can result in the wrong xz.exe or lzma.exe being found. Perform an explicit PATH search and force CreateProcess() to use the result. This change only affects the search for a compressor. The same problem also affects other uses of our popen(3) emulation. These may be addressed in future. Costs 64-80 bytes. (GitHub issue #376)
Diffstat (limited to 'networking')
-rw-r--r--networking/wget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/networking/wget.c b/networking/wget.c
index e0c66edba..f9e463f6c 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -844,7 +844,7 @@ static void spawn_ssl_client(const char *host, int network_fd, int flags)
844 (void *)_get_osfhandle(network_fd), servername, 844 (void *)_get_osfhandle(network_fd), servername,
845 flags & TLSLOOP_EXIT_ON_LOCAL_EOF ? " -e" : ""); 845 flags & TLSLOOP_EXIT_ON_LOCAL_EOF ? " -e" : "");
846 846
847 if ( (fd1=mingw_popen_fd(cmd, "b", -1, NULL)) == -1 ) { 847 if ( (fd1=mingw_popen_fd(NULL, cmd, "b", -1, NULL)) == -1 ) {
848 bb_perror_msg_and_die("can't execute ssl_client"); 848 bb_perror_msg_and_die("can't execute ssl_client");
849 } 849 }
850 850