X forgets who I am (ctwm, linux)

X forgets who I am (ctwm, linux)

Post by Nick Hillia » Fri, 18 Jun 1993 19:24:05




: [...]
: reset my DISPLAY var to "`hostname`:0.0". Furthermore, certain
: commands which need to check on my identity (like passwd or su1) can't
: find out who I am anymore if I use a shell started directly from the
: wm (X menu in root window).

: Does anyone have an idea what could possibly cause this?

Yep - After a *lot* of searching, I found that this problem is actually
caused by /bin/login not setting up entries in /etc/utmp properly.  It's a
simple enough matter to fix up the source to login to get it to work
properly.  Unfortunately, however, I've been temporarily de-linux'ed, and I
can make any patches :-(

If you want to fix it up yourself, get the sources for the shadow password
suite from the SLS distribution on disk s1, and edit login.c (I think). Near
the end of the file, there's a section for setting up the utmp entries.
You'll need to add a small piece of code in there somewhere to set
utmp->ut_id to whatever value it should take (ut_id should be a 2 character
string containing the terminal "id". For ptys, it should be the
last 2 characters of the device name. For the console (not actually
necessary for login.c), it should be "co", and so on.

Cheers,
Nick
--

| Quay Financial Software,       | Internet:  Real Soon Now               |
| Ferry House, Lower Mount St,   | Phone:     [+353] 1 6612377            |
| Dublin 2, Ireland.             | Fax:       [+353] 1 6607592            |