mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 00:14:44 +01:00
![]() lastlog2 is the 2038-safe replacement for wtmp, and in the meantime became part of util-linux. This commit switches from trying to parse the lastlog2 output to directly reading lastlog2.db with sqlite3. Adjust get_last_login_timestamp() to use the lastlog2 database (/var/lib/lastlog/lastlog2.db) if it exists, and adjust get_last_login_timestamp_lastlog2() to actually do that. (If lastlog2.db doesn't exist, aa-notify will read wtmp as usual.) Unfortunately lastlog2 doesn't have a way to get machine-readable output (for example json), therefore - after trying and failing to parse the lastlog2 output - directly read from lastlog2.db. Let's hope the format never changes ;-) Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1228378 Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1216660 Fixes: https://gitlab.com/apparmor/apparmor/-/issues/372 |
||
---|---|---|
.. | ||
lastlog2.db | ||
wtmp-aarch64 | ||
wtmp-aarch64-expected-output | ||
wtmp-s390x | ||
wtmp-s390x-expected-output | ||
wtmp-truncated | ||
wtmp-x86_64 | ||
wtmp-x86_64-expected | ||
wtmp-x86_64-past | ||
wtmp-x86_64-past-expected |