Nmap Development mailing list archives
Re: RFE: ncat should call shutdown on EOF
From: Henri Doreau <henri.doreau () gmail com>
Date: Fri, 7 Sep 2012 15:43:50 +0200
2012/8/2 Michal Hlavinka <mhlavink () redhat com>:
Hi, we're replacing nc in fedora with ncat and testing if the behaviour is similar enough. One of the differences is old nc calls shutdown on EOF. When ncat is used and gets EOF (ctrl-d) as an input, it does nothing unless --send-only is used. Would it be possible to call shutdown(fd,SHUT_WR) when ncat gets EOF in input? I used following patch. It works, but I don't know if it's correct way and correct place for this. --- nmap-6.01/ncat/ncat_connect.c.shutdown 2012-06-19 09:49:19.000000000 +0200 +++ nmap-6.01/ncat/ncat_connect.c 2012-08-02 15:10:34.173929687 +0200 @@ -713,7 +713,7 @@ static void read_stdin_handler(nsock_poo if (o.sendonly) { /* In --send-only mode, exit after EOF on stdin. */ nsock_loop_quit(nsp); - } + } else shutdown(nsi_getsd(cs.sock_nsi), SHUT_WR); return; } else if (status == NSE_STATUS_ERROR) { loguser("%s.\n", socket_strerror(nse_errorcode(evt))); Cheers, Michal
Sounds good to me. Any concern for supported non UNIX-like platforms? -- Henri _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- RFE: ncat should call shutdown on EOF Michal Hlavinka (Aug 03)
- Re: RFE: ncat should call shutdown on EOF Michal Hlavinka (Sep 05)
- Re: RFE: ncat should call shutdown on EOF Henri Doreau (Sep 07)
- Re: RFE: ncat should call shutdown on EOF Michal Hlavinka (Sep 10)
- Re: RFE: ncat should call shutdown on EOF David Fifield (Sep 10)
- Re: RFE: ncat should call shutdown on EOF Henri Doreau (Sep 10)
- Re: RFE: ncat should call shutdown on EOF Michal Hlavinka (Sep 10)