apparmor/utils
Christian Boltz 5053a01d84
aa-remove-unknown: abort on parser failure
If apparmor_parser -N (in profiles_names_list()) fails,
aa-remove-unknown possibly gets an incomplete list of profiles in
/etc/apparmor.d/ and therefore might remove more profiles than it
should.

Replace the profiles_names_list() call with a direct apparmor_parser
call, and abort aa-remove-unknown if it exits with $? != 0

Before:
```
aa-remove-unknown -n
AppArmor parser error for /etc/apparmor.d/broken in profile /etc/apparmor.d/broken at line 1: syntax error, unexpected TOK_ID, expecting TOK_OPEN
Would remove 'delete_me'
```

After:
```
./aa-remove-unknown -n
AppArmor parser error for /etc/apparmor.d in profile /etc/apparmor.d/zbroken at line 1: syntax error, unexpected TOK_ID, expecting TOK_OPEN
apparmor_parser exited with failure, aborting.
```

And of course, after fixing the broken profile:
```
./aa-remove-unknown -n
Would remove 'delete_me'
```
2022-02-11 22:59:01 +01:00
..
apparmor Add 'mctp' network domain keyword 2022-02-08 19:09:24 +01: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 replace deprecated distutils with setuptools 2021-11-11 20:23:35 -03:00
vim apparmor.vim: add support for abi rules 2020-12-09 22:44:33 +01: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 aa-decode: use grep -E instead of egrep 2021-08-24 10:16:29 +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 import AppArmorException from apparmor.common 2021-08-24 22:31:11 +02:00
aa-genprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-logprof import AppArmorException from apparmor.common 2021-08-24 22:31:11 +02:00
aa-logprof.pod treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
aa-mergeprof Change ask_the_questions() to work with merged profile names 2021-04-15 12:53:08 +02:00
aa-mergeprof.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-notify Move get_last_login_timestamp() into apparmor.notify 2021-10-24 14:23:15 +02:00
aa-notify.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
aa-remove-unknown aa-remove-unknown: abort on parser failure 2022-02-11 22:59:01 +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 aa-unconfined: Improve fallback handling to attr/current 2021-09-18 19:02:56 +02: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 Add new python versions to logprof.conf 2021-08-25 13:50:28 +02:00
logprof.conf.pod docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00
Makefile replace deprecated distutils with setuptools 2021-11-11 20:23:35 -03:00
notify.conf comment out use_group to remove group restrictions 2018-03-18 19:56:29 +01:00
python-tools-setup.py replace deprecated distutils with setuptools 2021-11-11 20:23:35 -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.