telnetd/telnet
jilles 0fddcbcf1c telnet: Fix infinite loop if local output generates SIGPIPE.
Instead of catching SIGPIPE and jumping out of the signal handler with
longjmp, ignore it and handle write errors to the local output by exiting
from there. I have changed the error message to mention the local output
instead of NetBSD's wrong "Connection closed by foreign host". Write errors
to the network were already handled by exiting immediately and this now
applies to EPIPE too.

The code assumed that SIGPIPE could only be generated by the network
connection; if it was generated by the local output, it would longjmp out of
the signal handler and write an error message which caused another SIGPIPE.

PR:		19773
Obtained from:	NetBSD
MFC after:	1 week


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@207449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2010-04-30 19:52:35 +00:00
..
authenc.c Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3. 2003-05-04 02:54:49 +00:00
commands.c telnet: Fix infinite loop if local output generates SIGPIPE. 2010-04-30 19:52:35 +00:00
defines.h Very large style makeover. 2001-11-30 21:06:38 +00:00
externs.h telnet: Fix infinite loop if local output generates SIGPIPE. 2010-04-30 19:52:35 +00:00
fdset.h This commit was generated by cvs2svn to compensate for changes in r29088, 1997-09-04 06:11:16 +00:00
general.h This commit was generated by cvs2svn to compensate for changes in r29088, 1997-09-04 06:11:16 +00:00
main.c o Make telnet[d] -S (IP TOS) flag really work. We do not have 2005-01-09 10:24:46 +00:00
network.c telnet: Fix infinite loop if local output generates SIGPIPE. 2010-04-30 19:52:35 +00:00
ring.c Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3. 2003-05-04 02:54:49 +00:00
ring.h Damn. The previous mega-commit was incomplete WRT ANSIfication. This 2001-11-30 22:28:07 +00:00
sys_bsd.c telnet: Fix infinite loop if local output generates SIGPIPE. 2010-04-30 19:52:35 +00:00
telnet.1 Markup nits. 2006-09-29 22:51:29 +00:00
telnet.c telnet: Fix infinite loop if local output generates SIGPIPE. 2010-04-30 19:52:35 +00:00
terminal.c telnet: Fix infinite loop if local output generates SIGPIPE. 2010-04-30 19:52:35 +00:00
types.h This commit was generated by cvs2svn to compensate for changes in r29088, 1997-09-04 06:11:16 +00:00
utilities.c Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3. 2003-05-04 02:54:49 +00:00