Subject: NetBSD's inetd
To: None <tech-net@NetBSD.ORG>
From: Darren Reed <firstname.lastname@example.org>
Date: 12/03/1997 16:37:50
Just looking at inetd.c (due to the current interest in how SIGPIPE
stuffs up Linux :), I notice that the accept() is passed a NULL
sockaddr pointer. It used to be - I assume, looking at FreeBSD inetd.c -
that getpeername immeadiately followed the accept().
With any gap between them, there is the potential for the remote-end
information to be lost if someone sends in a RST.
Is there any reason not to call accept() such that it can acquire the
remote information and pass that on ?
Also, I think that if getpeername() fails, inetd should log that in
inetd_setproctitle() and bail out rather than soldier on.