Permalink
Browse files

Add new --no-shutdown option to Ncat. Closes #151, fixes #142

  • Loading branch information...
bonsaiviking authored and qha committed Nov 10, 2015
1 parent ef16706 commit 6032ee437d9a226e993ac9bdc2ac88f114d0142f
Showing with 21 additions and 1 deletion.
  1. +4 −0 CHANGELOG
  2. +13 −0 ncat/docs/ncat.xml
  3. +1 −0 ncat/ncat_core.c
  4. +1 −0 ncat/ncat_core.h
  5. +1 −1 ncat/ncat_listen.c
  6. +1 −0 ncat/ncat_main.c
View
@@ -1,5 +1,9 @@
# Nmap Changelog ($Id$); -*-text-*-
o [Ncat] [GH#151] [GH#142] New option --no-shutdown prevents Ncat from shutting
down when it reads EOF on stdin. This is the same as traditional netcat's
"-d" option. [Adam Saparona]
o [NSE] Added ip-https-discover for detecting support for Microsoft's IP over
HTTPS tunneling protocol. [Niklaus Schiess]
View
@@ -775,6 +775,19 @@
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--no-shutdown</option> (Do not shutdown into half-duplex mode)
<indexterm><primary><option>--no-shutdown</option> (Ncat option)</primary></indexterm>
</term>
<listitem>
<para>If this option is passed, Ncat will not invoke shutdown on a
socket aftering seeing EOF on stdin. This is provided for
backward-compatibility with OpenBSD netcat, which exhibits this
behavior when executed with its '-d' option.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-t</option>,
View
@@ -168,6 +168,7 @@ void options_init(void)
o.keepopen = 0;
o.sendonly = 0;
o.recvonly = 0;
o.noshutdown = 0;
o.telnet = 0;
o.linedelay = 0;
o.chat = 0;
View
@@ -161,6 +161,7 @@ struct options {
int keepopen;
int sendonly;
int recvonly;
int noshutdown;
int telnet;
int linedelay;
int chat;
View
@@ -393,7 +393,7 @@ static int ncat_listen_stream(int proto)
receiving anything, we can quit here. */
return 0;
}
shutdown_sockets(SHUT_WR);
if (!o.noshutdown) shutdown_sockets(SHUT_WR);
}
if (rc < 0)
return 1;
View
@@ -286,6 +286,7 @@ int main(int argc, char *argv[])
{"source-port", required_argument, NULL, 'p'},
{"source", required_argument, NULL, 's'},
{"send-only", no_argument, &o.sendonly, 1},
{"no-shutdown", no_argument, &o.noshutdown,1},
{"broker", no_argument, NULL, 0},
{"chat", no_argument, NULL, 0},
{"talk", no_argument, NULL, 0},

0 comments on commit 6032ee4

Please sign in to comment.