wtmpdb as Y2038 safe wtmp replacement
Hi,
as already written, there are several Y2038 problems with glibc even on some 64bit architectures
(https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/).
There is now also an alternative to wtmp:
https://github.com/thkukuk/wtmpdb
https://www.thkukuk.de/blog/Y2038_glibc_wtmp_64bit/
In short, wtmpdb consist of a library, which provides a generic API to store login and logout times of an user. In contrast to wtmp, the logout time will not get an own entry, but the logout time is added to the existing login entry.
Additional, there is a tool "wtmpdb" to replace "last" ("wtmpdb last" tries to be compatible with "last" for the most options), which is also able to create the boot and shutdown entries.
pam_wtmpdb collects the login and logout times, so there is no need anymore for applications to bother about creating correct wtmp entries. Since there is no standard or something similar for this, currently it's a mess what applications are doing: some write up to three wtmp entries for the same user at login time, others use the generic /dev/console as TTY. This leads to the problem that last, who combines login/logout entries by comparing the user and TTY, is no longer able to correctly match the login and logout records and prints out wrong informations.
If an application does not know the TTY during authentication (like openssh), there is still libwtmpdb to create the entries.
Thorsten
Signature · 4 lines
Thorsten Kukuk, Distinguished Engineer, Senior Architect, Future Technologies SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nuernberg, Germany Managing Director: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman (HRB 36809, AG Nürnberg)