bin/176713: [patch] nc(1) closes network socket too soon
Adrian Chadd
adrian at freebsd.org
Sun Jul 21 06:34:23 UTC 2013
Wait a second. What's going on under the hood?
You _should_ be able to shutdown the write side of the socket and have
it not affect reading. It's a broken server if it does a read(), find
that the socket is returning EOF, and then not waiting for the write()
to fail before closing.
If that's actually what's going on - if you can verify that indeed its
not some local broken handling of shutdown(fd, WR) then yes, I think
it's worth changing nc. And I do think it's worth adding a "call
shutdown(fd, WR) once the sender is finished" option for people that
want it.
-adrian
On 20 July 2013 07:31, Ronald F. Guilmette <rfg at tristatelogic.com> wrote:
>
>
> Could someone please take a look at this bug report (bin/176713) and
> also at the simple patch that I provided to fix the problem?
>
> This is quite a serious problem, and my PR has been pending with no
> action since Wed, 6 Mar 2013.
>
>
> Regards,
> rfg
>
>
> P.S. Please note that in reality, I do not believe that it is necessary
> to add a new -q option in order to preserve backwards compatability, however
> I proposed one because in my experience there is always going to be some
> purist who will claim that *any* change in semantics, however small or
> helpful, in *any* software ``may'' break something. In reality, the
> problem in this can most easily be solved simply by removing the one
> statement:
>
> shutdown(nfd, SHUT_WR);
>
> entirely from the source, rather than making it conditional on -q, as I
> suggested in my PR, bin/176713.
>
> P.P.S. I have just realized that yet one more critical enhancement for
> nc is called for, and I will be filing a separate and additional PR for
> that soon. I hope that someone will be able to take a look at that as
> soon as it is filed.
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list