1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-01 11:09:07 +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:
d33tah
2013-07-23 12:36:09 +00:00
parent aa1b31450b
commit f5a142b0d4

View File

@@ -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();