[bug] forcing telnetd to exit and loose all other sessions

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Tue Sep 26 08:58:35 UTC 2006


On Fri, 22 Sep 2006, Cristian Ionescu-Idbohrn wrote:

> # telnet target-box < /dev/null
>
> (you may need to run the above command several times in a row to
> reproduce the bug)
>
> While the daemon is trying to 'write' the issuefile and the login
> prompt to client, the client kills the connection. The daemon does not
> catch the SIGPIPE and passes away.
>
> A signal handler could improve the daemons chanses to survive.
>
> The SIGPIPE occurs while attemting to write to 'ts->sockfd', around
> line 578:
>
> ,---- [ networking/telnetd.c ]
> | 578		w = write(ts->sockfd, ts->buf2 + ts->wridx2, maxlen);
> | 579		if (w < 0) {
> | 580			free_session(ts);
> | 581			ts = next;
> | 582			continue;
> | 583		}
> `----

Please find attached a WFM patch against bb-1.1.3 which should resolv
the reported problem. Comments anyone?


Cheers,
Cristian



More information about the busybox mailing list