From 3eaaac2f84e580246724725da380ac47e0ebc07e Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 8 Mar 2019 15:12:52 +0000 Subject: su, wget: use magic '--busybox' flag I've been a bit lax about ensuring the --busybox flag is passed in command lines. It's needed to avoid problems if the binary is called something like sh.exe. --- loginutils/suw32.c | 7 ++----- networking/wget.c | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/loginutils/suw32.c b/loginutils/suw32.c index be1a5211e..d51a7f58c 100644 --- a/loginutils/suw32.c +++ b/loginutils/suw32.c @@ -28,7 +28,6 @@ int suw32_main(int argc UNUSED_PARAM, char **argv) { char *opt_command = NULL; SHELLEXECUTEINFO info; - char *cwd; getopt32(argv, "c:", &opt_command); if (argv[optind]) @@ -40,12 +39,10 @@ int suw32_main(int argc UNUSED_PARAM, char **argv) /* info.hwnd = NULL; */ info.lpVerb = "runas"; info.lpFile = bb_busybox_exec_path; - cwd = getcwd(NULL, 0); + info.lpParameters = xasprintf("--busybox ash -d \"%s\"", getcwd(NULL, 0)); if (opt_command) info.lpParameters = - xasprintf("ash -d \"%s\" -s -c \"%s\"", cwd, opt_command); - else - info.lpParameters = xasprintf("ash -d \"%s\"", cwd); + xasprintf("%s -s -c \"%s\"", info.lpParameters, opt_command); /* info.lpDirectory = NULL; */ info.nShow = SW_SHOWNORMAL; diff --git a/networking/wget.c b/networking/wget.c index bb70039f9..d907cee30 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -789,7 +789,8 @@ static void spawn_ssl_client(const char *host, int network_fd, int flags) fflush_all(); - cmd = xasprintf("%s ssl_client -h %p -n %s%s", bb_busybox_exec_path, + cmd = xasprintf("%s --busybox ssl_client -h %p -n %s%s", + bb_busybox_exec_path, (void *)_get_osfhandle(network_fd), servername, flags & TLSLOOP_EXIT_ON_LOCAL_EOF ? " -e" : ""); -- cgit v1.2.3-55-g6feb