I don't know if it is a real bug or not, but the GNU version 0.7.1 seems to differ from some other versions of netcat in its treatment of EOF on the standard input.
On our SunOS 5.9 system:
cat /dev/null | nc mail2 25
prints the sendmail banner, but then hangs. On our Linux Fedora 7 system a non-Gnu version of nc prints the banner and then exits cleanly. This would seem to be preferable if feasible.
Of course, we don't really care about sendmail and nc, but I thought this would be an easily reproduced demonstration of something that gets to be a problem for our actual server. The same effect is visible with other small servers, viz echo and discard:
cat /dev/null | nc localhost 7
cat /dev/null | nc localhost 9
which return immediately on Linux, but hang on Gnu nc.
1050 Mass Ave
Cambridge MA 02138
Log in to post a comment.