Description of problem: Because ncat is going to replace nc: Old 'nc' calls shutdown(2) when the corresponding site has been closed. This makes data transfer very easy because both sites terminate automatically when all data have been sent. New 'ncat' does not shutdown the fds which causes the programs to stay forever: --- new --- $ nc -l 1234 > /tmp/foo # program #1 / server $ ncat `hostname` 1234 # program #2 / client type-some-text ^D ---> neither program #1 nor #2 terminate --- old --- $ nc -l 1234 > /tmp/foo # program #1 / server $ nc `hostname` 1234 # program #2 / client type-some-text ^D --> program #1 and #2 terminate on EOF of client (Note: examples use manually typed input; a more common example is something like nc `hostname` 1234 < some-file which does not work with ncat anymore) Version-Release number of selected component (if applicable): nmap-6.00-1.fc17.x86_64
ncat does not call close nor shutdown on EOF. If you want it to terminate connection on EOF, use --send-only. Anyway, I can see it'd be nice if it called shutdown(fd, SHUT_WR) in the above case. I'll ask upstream for their opinion.
fwiw, in my use case, the server side reads the file completely over TCP, processes it and gives a status output to client. With '--sent-only' the status output will be supressed and (yet more) worse, a broken pipe might be seen on server when client terminates the connection on stdin EOF instead of waiting for the server closing the connection. E.g. server makes: | timeout -t 600 cat > some-file | echo "Processing file..." | process-file | echo "Done"
upstream accepted the patch
nmap-6.01-2.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/nmap-6.01-2.fc17
nmap-6.01-6.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/nmap-6.01-6.fc18
Package nmap-6.01-6.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing nmap-6.01-6.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-14386/nmap-6.01-6.fc18 then log in and leave karma (feedback).
nmap-6.01-6.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
This is still not fully fixed. The EOF handling works from client to server but not the other way. That is: $ nc -l 1234 Type something ^D $ nc localhost 1234 > data Does not terminate too. if I replace the listening netcat with the original (not from nmap) one, it will terminate fine regardless of whether the client side is original or nmap netcat.
nmap-6.01-3.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/nmap-6.01-3.fc17
nmap-6.01-2.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/nmap-6.01-2.fc16
nmap-6.01-8.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/nmap-6.01-8.fc18
Package nmap-6.01-8.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing nmap-6.01-8.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-19398/nmap-6.01-8.fc18 then log in and leave karma (feedback).
nmap-6.01-8.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
nmap-6.01-3.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.
nmap-6.01-2.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.