mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-06 01:11:00 +01:00
![]() When creating a child profile while using genprof, I get a backtrace: Traceback (most recent call last): File "aa-genprof", line 160, in <module> lp_ret = apparmor.do_logprof_pass(logmark, passno) File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/aa.py", line 2291, in do_logprof_pass save_profiles() File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/aa.py", line 2309, in save_profiles for prof_name in changed.keys(): RuntimeError: dictionary changed size during iteration (See https://bugs.launchpad.net/apparmor/+bug/1014304 for more details.) After digging into the code, it seems for some reason the child profile is added to "changed" - I doubt this is correct (guess why it's removed later... ;-) After digging a bit more, I found out that create_new_profile() is (ab)used to create a new stub profile to be used as child profile. create_new_profile then adds the new child (which looks like a normal profile to it) to "changed". This patch most probably makes the cleanup round in save_profile() superfluous by adding a is_stub parameter to create_new_profile(). If this parameter is set, the new (child) profile is not added to "created" and "changed". I intentionally added the two print() lines in safe_profile because a) I think they will never be displayed b) I want to know if a) is wrong ;-) c) it's always nice to have a "nice" error message before displaying a backtrace ;-) 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-exec | ||
aa-exec.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 | ||
apparmor-utils.spec.in | ||
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.