Subject: Re: bin/28115
To: Christos Zoulas <firstname.lastname@example.org>
From: Ed Ravin <email@example.com>
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, firstname.lastname@example.org (Ed Ravin) wrote:
> -- Subject: Re: bin/28115
> | On Thu, Nov 11, 2004 at 01:15:44AM +0000, email@example.com wrote:
> | > Synopsis: telnetd -u0 functionality missing from NetBSD 2.0
> | >
> | > State-Changed-From-To: open->feedback
> | > State-Changed-By: firstname.lastname@example.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.