[gdm-list] Old sessreg, gdm utmpwtmp and utmp->ut_id



Hi,

I'm running a few thinclient servers that use gdm as xdmcp. Gdm while a nice
xdmcp server fails to store utmpwtmp information for remote clients.

Back in the days when gdm Presession called sessreg, I've to patch sessreg
to store a hash of the display string in utmp->ut_id, as the id was what glibc
used a "unique identifier" in the utmp file, and without the patch all the
users in my network ended up with the same id, this caused commands like who,
to list only the last login session, thus a pain to administer. The hash used had
a very small collission rate, so, it worked quite nicelly. The patch was
accepted in sessreg, so every other admin might not have noticed the problem.

After upgrading to gdm 2.20, the code to update utmpwtmp was moved to gdm
itself, and it's coded only for local users, remote users won't set ut_line or
ut_id, so the same problem back again. Commands like who, would only report the
last logged in user. In addition, gdm won't obtain the hostname, so, only the
ip address is stored. Once again a pain to administed effectivelly.

So, once again, I'll need to fix this. I'm looking at the code of gdm 2.21,
and it seems to have some remote users utmpwmtp registering, but it uses the
first 4 char of the display, which is quite prune to generate collissions,
also, the code of utmpx in glibc uses ut_id only optionally now, so it might be
better to use ut_line as the "unique identifier", and forget about ut_id (it
must be zeroed).

As POSIX defines ut_line as a 32 bytes long string (using utmpx, which gdm
2.21 is using), it might be needed to tweak the string a bit (making sure the
display number is available, even with a long display string). I don't really
know the status of vnc remote display or X11 disconnection support nor the
display string those would generate, but when those are defined it might be
needed to tweak the ut_line once again.

Also, gdm_session_record_login and gdm_session_record_logout use getutxent to
iterate over the utmp file, which is quite inefficient, as that's the job of
getutxline.

If everything sound fine to you, I'll prepare and send the patch.

Happy hacking,
-- 
"The day Microsoft makes something that doesn't suck,
is probably the day Microsoft starts making vacuum cleaners."
	-- Ernst Jan Plugge
Saludos /\/\ /\ >< `/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]