apparmor/utils
John Johansen 7c88f02d6a aa-notify: don't crash if the logfile is not present due to rotation
If aa-notify races file rotation it may crash with a trace back to
the log file being removed before the new one is moved into place.

    Traceback (most recent call last):
       File "/usr/sbin/aa-notify", line 570, in <module>
         main()
       File "/usr/sbin/aa-notify", line 533, in main
          for message in notify_about_new_entries(logfile, args.wait):
       File "/usr/sbin/aa-notify", line 145, in notify_about_new_entries
         for event in follow_apparmor_events(logfile, wait):
       File "/usr/sbin/aa-notify", line 236, in follow_apparmor_events
         if os.stat(logfile).st_ino != log_inode:
    FileNotFoundError: [Errno 2] No such file or directory: '/var/log/audit/audit.log'

If we hit this situation sleep and then retry opening the logfile.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/130
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/688
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2020-11-30 05:19:28 -08:00
..
apparmor Merge create_new_profile(): check if abstractions exist 2020-11-28 13:19:13 +00:00
easyprof Add aa-easyprof and easyprof.py and related pieces from the Ubuntu 2014-02-13 17:53:40 -08:00
po Fix hotkey conflict in utils de.po, id.po and sv.po 2020-10-31 21:59:32 +01:00
test Merge Add --configdir to all aa-* utils 2020-11-28 13:02:06 +00:00
vim apparmor.vim: allow leading whitespace for alias rules 2020-05-10 17:24:09 +02:00
aa-audit Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-audit.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-autodep Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-autodep.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-cleanprof Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-cleanprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-complain Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-complain.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-decode Rewrite aa-decode to use inline Python instead of to-be-deprecated Perl 2019-02-05 00:20:47 +02:00
aa-decode.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-disable Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-disable.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-easyprof Switch utils to python3 2016-10-01 20:57:09 +02:00
aa-easyprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-enforce Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-enforce.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-genprof Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-genprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-logprof Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-logprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-mergeprof Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-mergeprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-notify aa-notify: don't crash if the logfile is not present due to rotation 2020-11-30 05:19:28 -08:00
aa-notify.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-remove-unknown Don't print a literal '\n' in aa-remove-unknown help 2017-12-01 00:26:56 +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 Switch utils to python3 2016-10-01 20:57:09 +02:00
aa-sandbox.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-unconfined Add --configdir to all aa-* utils 2020-10-29 21:24:15 +01:00
aa-unconfined.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
check_po.pl Ignore untranslated texts in check_po.pl 2017-11-27 23:47:52 +01:00
logprof.conf Drop profile repo code from utils 2020-05-05 13:09:16 +02:00
logprof.conf.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
Makefile utils: split linting with PYFLAKES into a separate target. 2020-10-21 16:55:41 -07:00
notify.conf comment out use_group to remove group restrictions 2018-03-18 19:56:29 +01:00
python-tools-setup.py docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07: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.