mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
![]() Change aa.py to use FileRule and FileRuleset for parsing and saving profiles. In detail, this means: - add 'file' to the list of rule classes to enable it at various places - store file rules in aa[profile][hat]['file'] (not 'path' as before) to be consistent with the FileRule name - drop the no longer needed delete_path_duplicates() - this is now handled by FileRuleset like in all other rule classes. (same change in cleanprofile.py) - replace usage of RE_PROFILE_BARE_FILE_ENTRY and RE_PROFILE_PATH_ENTRY with FileRule.match() - drop write_path_rules() and write_paths() and replace them with the new write_file() function. - adjust several code sections to use write_file() and 'file' instead of 'path' FileRule doesn't drop optional keywords ('allow' and 'file'), therefore adjust cleanprof_test.out to the changed behaviour. (If someone insists on dropping optional keywords in aa-cleanprof, that's something for a future patch.) Also adjust the list of known failures in test-parser-simple-tests.py - switching to FileRule avoids several test failures (and introduces a few new ones ;-) IMPORTANT: This patch introduces a "brain split" which means - parsing and writing the profile and aa-cleanprof use the new location (aa[profile][hat]['file']) - aa-logprof and aa-genprof still save data to the old location (aa[profile][hat]['allow']['path']) and probably ask superfluous questions because there are no rules existing in the old location TL;DR: don't try aa-logprof or aa-genprof with only this patch applied. I know this isn't ideal, but still better than an even bigger and totally unreadable patch ;-) Acked-by: Steve Beattie <steve@nxnw.org> |
||
---|---|---|
.. | ||
apparmor | ||
easyprof | ||
po | ||
test | ||
vim | ||
aa-audit | ||
aa-audit.pod | ||
aa-autodep | ||
aa-autodep.pod | ||
aa-cleanprof | ||
aa-cleanprof.pod | ||
aa-complain | ||
aa-complain.pod | ||
aa-decode | ||
aa-decode.pod | ||
aa-disable | ||
aa-disable.pod | ||
aa-easyprof | ||
aa-easyprof.pod | ||
aa-enforce | ||
aa-enforce.pod | ||
aa-genprof | ||
aa-genprof.pod | ||
aa-logprof | ||
aa-logprof.pod | ||
aa-mergeprof | ||
aa-mergeprof.pod | ||
aa-notify | ||
aa-notify.pod | ||
aa-sandbox | ||
aa-sandbox.pod | ||
aa-status | ||
aa-status.pod | ||
aa-unconfined | ||
aa-unconfined.pod | ||
check_po.pl | ||
logprof.conf | ||
logprof.conf.pod | ||
Makefile | ||
notify.conf | ||
python-tools-setup.py | ||
README.md | ||
severity.db |
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.