mirror of
https://github.com/nmap/nmap.git
synced 2026-08-27 03:48:14 +00:00
make --lua-exec-internal switch STDOUT to binary mode. (this was merged from nmap-exp/d33tah/lua-exec-examples/ncat, r31481)
This commit is contained in:
parent
aa1b31450b
commit
f5a142b0d4
1 changed files with 7 additions and 0 deletions
|
|
@ -500,6 +500,13 @@ int main(int argc, char *argv[])
|
|||
forking in POSIX builds, Windows does not have the fork() system
|
||||
call and thus requires this workaround. More info here:
|
||||
http://seclists.org/nmap-dev/2013/q2/492 */
|
||||
#ifdef WIN32
|
||||
if (o.debug)
|
||||
logdebug("Enabling binary stdout for the Lua output.\n");
|
||||
int result = _setmode(_fileno(stdout), _O_BINARY);
|
||||
if (result == -1)
|
||||
perror("Cannot set mode");
|
||||
#endif
|
||||
ncat_assert(argc == 3);
|
||||
o.cmdexec = argv[2];
|
||||
lua_setup();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue