mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Try to rescue users in one simple case
This commit is contained in:
parent
92224d5470
commit
52508f77bb
1 changed files with 13 additions and 1 deletions
|
|
@ -191,6 +191,7 @@ static int run_command_redirected(char *cmdexec, struct subprocess_info *info)
|
|||
SECURITY_ATTRIBUTES sa;
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
char *app_name = NULL;
|
||||
|
||||
setup_environment(&info->fdn);
|
||||
|
||||
|
|
@ -248,7 +249,18 @@ static int run_command_redirected(char *cmdexec, struct subprocess_info *info)
|
|||
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
|
||||
if (CreateProcess(NULL, cmdexec, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi) == 0) {
|
||||
/* The user ought to quote the binary name if it contains spaces, but they
|
||||
* might not. If it's not quoted, we'll try to help them out. */
|
||||
if (cmdexec[0] != '"') {
|
||||
DWORD dwType = 0;
|
||||
/* Check if the whole command is just the name of an executable file. */
|
||||
if (GetBinaryType(cmdexec, &dwType)) {
|
||||
/* If so, pass this to CreateProcess to avoid space-splitting */
|
||||
app_name = cmdexec;
|
||||
}
|
||||
}
|
||||
|
||||
if (CreateProcess(app_name, cmdexec, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi) == 0) {
|
||||
if (o.verbose) {
|
||||
LPVOID lpMsgBuf;
|
||||
FormatMessage(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue