apparmor/utils
Christian Boltz 45e4c27cf0
Add support for lastlog2 to get last login
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
2025-01-14 19:36:43 +01:00
..
apparmor Add support for lastlog2 to get last login 2025-01-14 19:36:43 +01:00
easyprof Add aa-easyprof and easyprof.py and related pieces from the Ubuntu 2014-02-13 17:53:40 -08:00
po Update po README with correct directories and pygettext3 binary 2024-09-03 09:35:05 -07:00
test Add support for lastlog2 to get last login 2025-01-14 19:36:43 +01:00
vim Third iteration of spread support 2024-12-05 02:17:07 +01:00
aa-audit Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-audit.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-autodep Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-autodep.pod Stop calling ldd in aa-genprof and aa-autodep 2024-03-31 18:53:12 +02:00
aa-cleanprof Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-cleanprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-complain Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-complain.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-decode aa-decode: "fix" all remaining shellcheck style violations 2022-02-13 19:43:48 +00:00
aa-decode.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-disable Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-disable.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-easyprof Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-easyprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-enforce Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-enforce.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-genprof utils: fix coding style to match PEP8 2024-05-20 13:56:37 -03:00
aa-genprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-logprof aa-logprof/aa-genprof: Adding support for --allow-all, --output-dir and --no-abstraction 2024-03-28 19:29:08 +00:00
aa-logprof.pod treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
aa-mergeprof Switch aa-mergeprof from aa to active_profiles 2024-12-17 22:51:12 +01:00
aa-mergeprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-notify Remove match statements in utils for older Python compatibility 2024-12-02 10:47:16 -08:00
aa-notify.desktop Add .desktop file for aa-notify 2022-02-12 09:34:26 +00:00
aa-notify.pod aa-notify: Simplify user interfaces and update man page 2024-09-17 09:17:23 +00:00
aa-remove-unknown Support unloading profiles in kill and prompt mode 2025-01-13 18:07:39 +01:00
aa-remove-unknown.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-sandbox Order imports and module-level dunder name assignments. 2022-08-21 11:15:07 -04:00
aa-sandbox.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-unconfined utils/aa-unconfined: add a --short option 2024-07-10 16:11:22 -07:00
aa-unconfined.pod utils/aa-unconfined: add support to list processes with any network sockets 2024-07-10 16:11:22 -07:00
check_po.pl Ignore untranslated texts in check_po.pl 2017-11-27 23:47:52 +01:00
com.ubuntu.pkexec.aa-notify.policy aa-notify: Adding support for merging notification. 2024-11-26 18:35:37 +00:00
default_unconfined.template aa-notify: Enhanced Graphical User Interfaces 2024-08-13 16:58:25 +00:00
logprof.conf Stop calling ldd in aa-genprof and aa-autodep 2024-03-31 18:53:12 +02:00
logprof.conf.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
Makefile aa-notify: Enhanced Graphical User Interfaces 2024-08-13 16:58:25 +00:00
notify.conf aa-notify: Adding support for merging notification. 2024-11-26 18:35:37 +00:00
python-tools-setup.py utils: change os.mkdir to self.mkpath to create intermediary dirs 2024-08-15 00:44:55 -03:00
README.md Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
severity.db Add CAP_CHECKPOINT_RESTORE to severity.db 2020-10-14 14:01:55 +02:00

Known Bugs: Will allow multiple letters in the () due to translation/unicode issues with regexing the key. User input will probably bug out in a different locale.