GDM incorrectly overwrites the utmpx entry
GDM 3.24.2 on Soalris11.4
Steps to Reproduce:
-
login via VNC (user:root)
-
Run the finger command
$ finger Login Name TTY Idle When Where root Super-User pts/2 Wed 12:11 hogehoge root Super-User *::1:0 Wed 12:15 ::1::1:0
-
login via VNC (user:vnc)
-
Run the finger command and last command
$ finger Login Name TTY Idle When Where root Super-User pts/2 Wed 12:11 hogehoge vnc ??? *::1:1 Wed 12:17 ::1::1:1
Lost(overwrite) root user entry.
% last | head vnc ::1:1 ::1::1:1 Wed Mar 20 12:17 still logged in root ::1:0 ::1::1:0 Wed Mar 20 12:15 still logged in
The last command is displays root entry.
How reproducible: Every time
The source of finger is utmpx.
I think that is the effect of deleting record_set_id from daemon/gdm-session-record.c.
gdm registers with /var/adm/utmpx using pututxline().
pututxline() checks utmpx for the same ut_id.
If there is the same ut_id, overwrite the entry.
gdm does not record ut_id. (Both root and vnc user ut_id is NULL.)
pututxline() overwrites the root user's entry because no distinction between root and vnc users.