Subject: Re: Problems with getlogin() returning "root" in NetBSD 1.0/-current
To: None <firstname.lastname@example.org>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
Date: 12/17/1994 02:09:36
>> This begs the obvious question, why isn't this field - i.e., the "s_login"
>> field in the per-process session structure - being set to NULL?
> Why should it be?
Erm, because as a per-process structure element, it most definitely shouldn't
be "root", because that's wrong. If there's nothing to set it to the right
value, then it should be blank, I would think.
>> On the other hand, I'm willing to listen to arguments that "xdm" should be
>> doing the setlogin(), either internally or via an external program; what
>> do all you XFree86-using folks think?
> [ Why be XFree86 specific? ]
I was assuming that the vast majority of X11-on-NetBSD users were using
XFree86, not us renegade NetBSD/SPARC Xsun crowd :-)
> setlogin(2) says:
> Setlogin() sets the login name of the user associated with the current
> session to name. This call is restricted to the super-user, and is nor-
> mally used only when a new session is being created on behalf of the
> named user (for example, at login time, or when a remote shell is
> `xdm' is a used to login to a system. It should be calling setlogin().
Paging Mr. Ferguson ... Mr. George Ferguson ... please come to a white
courtesy telephone ...
>> Anyway, I'm throwing this out because it seems like a bug but maybe I'm
>> unaware of some potential side issue with other ramifications.
> Yup. It's a bug in xdm.
I'd tend to agree with this ...
The funny thing is that "xdm" comes with this little wtmp/utmp frobber called
"sessreg" that would probably be perfect for the job, but the "make install"
in /usr/X11R6/src/xc/programs/xdm (or wherever your R6 source tree is) doesn't
install it by default, for reasons that are lost on me ... (i.e., it doesn't
really belong in "xdm" proper as long as there's this "sessreg" program to do
this type of session registration stuff, but if the program you now depend on
to do it isn't going to get installed, whaddya do?)