On Sun, Jul 13, 2014 at 03:00:09PM +0200, Christian Boltz wrote: > Hello, > > this patch fixes a crash in aa-logprof (to be exact: save_profiles() in > aa.py) when saving the remaining profile after using "save selected > profile". > > When using "save selected profile", write_profile() (called by > write_profile_ui_feedback()) does "changed.pop(profile_name)". > However, saving the remaining profiles in save_profiles() uses a cached > version of changed.keys() and therefore tries to save a profile that > was already saved and is no longer part of "changed". > > Here's what save_profiles() does: > > changed_list = sorted(changed.keys()) > [...] > if ans == 'CMD_SAVE_SELECTED': > profile_name = list(changed.keys())[arg] > write_profile_ui_feedback(profile_name) > > Note that write_profile_ui_feedback() calls write_profile(), which does > "changed.pop(profile_name)" > > [...] > for profile_name in changed_list: > write_profile_ui_feedback(profile_name) > > When finally saving the remaining profiles, the outdated changed_list > is used. > > > The patch also removes two commented lines we'll never need again: > - #changed.pop is done in write_profile() > - q['options'] is set some lines above > > References: https://bugs.launchpad.net/apparmor/+bug/1341178
Acked-by: Steve Beattie <[email protected]> Thanks. -- Steve Beattie <[email protected]> http://NxNW.org/~steve/
signature.asc
Description: Digital signature
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
