Index: CHANGELOG =================================================================== --- CHANGELOG (revision 13157) +++ CHANGELOG (working copy) @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Ncat] When using --send-only, Ncat will now close the network + connection and terminate on receiving EOF on standard input. + o [Ncat] Unbreak hostname resolution on BSD systems where a recently fixed libc bug caused getaddrinfo(3) to fail unless a socket type hint is provided. Patch originally provided by Hajimu UMEMOTO of Index: ncat/ncat_connect.c =================================================================== --- ncat/ncat_connect.c (revision 13157) +++ ncat/ncat_connect.c (working copy) @@ -380,8 +380,10 @@ } /* end switch */ } else if (status == NSE_STATUS_EOF) { - /* Close up, got EOF from network side */ - if (nsi == cs->sock_nsi) { + /* Close up if we either got EOF from network side (e.g. the + * TCP connection closed on remote side), or if we got EOF + * on stdin while using --send-only mode. */ + if (nsi == cs->sock_nsi || o.sendonly) { nsi_delete(cs->stdin_nsi, NSOCK_PENDING_NOTIFY); nsi_delete(cs->sock_nsi, NSOCK_PENDING_NOTIFY); } Index: ncat/docs/ncat.xml =================================================================== --- ncat/docs/ncat.xml (revision 13157) +++ ncat/docs/ncat.xml (working copy) @@ -610,7 +610,9 @@ If this option is passed, then Ncat will only send data and will - ignore anything received. + ignore anything received. This option also causes Ncat to close the + network connection and terminate after EOF is received on standard + input. Index: ncat/ncat_main.c =================================================================== --- ncat/ncat_main.c (revision 13157) +++ ncat/ncat_main.c (working copy) @@ -392,7 +392,7 @@ printf(" -u, --udp Use UDP instead of default TCP\n"); printf(" -v, --verbose Set verbosity level (can be used up to 3 times)\n"); printf(" -w, --wait