[14795] in Athena Bugs
sun4 8.0J: login
daemon@ATHENA.MIT.EDU (bdrosen@MIT.EDU)
Thu Oct 31 14:03:57 1996
From: bdrosen@MIT.EDU
To: bugs@MIT.EDU
Date: Thu, 31 Oct 1996 14:03:28 EST
System name: cogsworth
Type and version: SPARC/5 8.0J (1 update(s) to same version)
Display type: cgthree
What were you trying to do?
Do a tty login to a sun station and have the utmpx
info reported by finger be correct.
What's wrong:
It isn't. It appears that if you do the following:
struct utmp a;
struct utmpx b;
fill in b with normal info
write b to the utmpx file and do the following:
getutmp(&b, &a);
setutent();
pututline(&a);
then the entry in the utmpx file corresponding to b will be overwritten
by a (the utmpx structure used to overwrite b will be the same as the
one created by calling getutmpx on a)
This causes the ut_host part of utmpx to be empty .
(unless there are two entries in the utmpx file for the user)
What i think happens is that pututline communicates to utmpd
via /etc/utmppipe and causes utmpd to do the overwriting.
(the pututline is definitely the problem)
xlogin (verify.c) does not have this problem as it writes utmp
before utmpx like it should. (apparently)
I am not sure if pututxline does the same thing with utmpd.
If it does, login/xlogin probably only needs to write to
the utmpx file since utmpd will take care of the utmp file.
What should have happened:
The utmpx entry b should not have been overwritten.
(reversing the order of writing to the utmp and utmpx
files fixes this)
Please describe any relevant documentation references:
man getutmpx
man utmpd (if there was a man page for it)