Subject: Re: bin/28115
To: Christos Zoulas <christos@zoulas.com>
From: Ed Ravin <eravin@panix.com>
List: netbsd-bugs
Date: 11/14/2004 02:38:29
On Thu, Nov 11, 2004 at 03:20:50PM -0500, Christos Zoulas wrote:
> On Nov 11, 1:46pm, eravin@panix.com (Ed Ravin) wrote:
> -- Subject: Re: bin/28115
>
> | On Thu, Nov 11, 2004 at 01:15:44AM +0000, christos@narn.netbsd.org wrote:
> | > Synopsis: telnetd -u0 functionality missing from NetBSD 2.0
> | >
> | > State-Changed-From-To: open->feedback
> | > State-Changed-By: christos@narn.netbsd.org
> | > State-Changed-When: Wed, 10 Nov 2004 20:15:43 -0500
> | > State-Changed-Why:
> | > I added -n to last and fixed ftpd to record the proper address.
> | > Is that ok?
The "last -n" changes work as expected. But there's another problem:
/usr/bin/login does not write anything into ut_ss when it is invoked
by telnetd. With our initial tests, an IP address appears in ut_ss when
using ftpd with your recent changes, but not when using telnetd.
I see that usr.bin/login/login.c does this:
(void)getpeername(STDIN_FILENO, (struct sockaddr *)&ss, &len);
[...]
utmpx.ut_ss = ss;
But when /usr/bin/login is invoked from telnetd, stdin is a PTY, not a
regular socket, so I don't think getpeername will return anything useful.
Maybe putting -u0 back into telnetd isn't such a bad idea after all.