From c3d079a5844b0df19f200099ac6561050db12cc2 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 2 Mar 2013 07:34:49 +0000 Subject: [PATCH] Namespace subprocess pipes by PID. Patch by Andrey Olkhin. http://seclists.org/nmap-dev/2013/q1/210 --- CHANGELOG | 4 ++++ ncat/ncat_exec_win.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index febad5906..e8e8d21fc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o Namespace the pipes used to communicate with subprocesses by PID, to + avoid multiple instances of Ncat from interfering with each other. + Patch by Andrey Olkhin. + o Nmap may now partially rearrange its target list for more efficient host groups. Previously, a single target with a different interface, or with an IP address the same as a that of a target already in the diff --git a/ncat/ncat_exec_win.c b/ncat/ncat_exec_win.c index 3540761ba..e77631f39 100644 --- a/ncat/ncat_exec_win.c +++ b/ncat/ncat_exec_win.c @@ -220,7 +220,8 @@ static int run_command_redirected(char *cmdexec, struct subprocess_info *info) } /* Pipe names must have this special form. */ - Snprintf(pipe_name, sizeof(pipe_name), "\\\\.\\pipe\\ncat-%d", pipe_serial_no); + Snprintf(pipe_name, sizeof(pipe_name), "\\\\.\\pipe\\ncat-%d-%d", + GetCurrentProcessId(), pipe_serial_no); if (o.debug > 1) logdebug("Creating named pipe \"%s\"\n", pipe_name);