Subject: Re: bin/30915: sshd via inetd and changing logname
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 08/05/2005 18:27:02
The following reply was made to PR bin/30915; it has been noted by GNATS.
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/30915: sshd via inetd and changing logname
Date: Fri, 5 Aug 2005 19:26:05 +0100
On Thu, Aug 04, 2005 at 10:24:01PM +0000, reed@reedmedia.net wrote:
> >Synopsis: sshd via inetd and changing logname
> My sshd is started from inetd:
> ssh stream tcp nowait root /usr/sbin/sshd sshd -i
>
> dmesg reports like:
> sshd (pid 9703) changing logname from reed to reedmedia
The problem is almost certainly that sshd is calling setlogin() before
calling setsid(). This causes the logname of the daemon process (and,
IIRC, all its current children - including all other login sessions)
to be changed, instead of just setting the logname for the new session.
The kernel printf is there to identify the problem - the request can't
be errored because it is a valid one (if unusual) and setlogin() is the
sort of function that it really isn't worth testing the result of.
David
--
David Laight: david@l8s.co.uk