From: Thorsten Kukuk <kukuk@suse.com>
To: distributions@lists.linux.dev
Subject: wtmpdb as Y2038 safe wtmp replacement
Date: Wed, 12 Apr 2023 13:45:26 +0000 [thread overview]
Message-ID: <20230412134526.GA11939@suse.com> (raw)
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
--
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)
reply other threads:[~2023-04-12 13:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230412134526.GA11939@suse.com \
--to=kukuk@suse.com \
--cc=distributions@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox