[apparmor] [patch] fix crash in aa-genprof
Christian Boltz
apparmor at cboltz.de
Wed May 21 21:05:20 UTC 2014
Hello,
this patch fixes autodep() in aa.py which fills filelist[] with a wrong
structure (one nesting level missing), which then causes aa-genprof to
crash when pressing "s" for "scan".
References:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1319829
BTW: We should document the internal structure of our more
interesting[tm] variables. filelist is one of them (and probably still
the easiest one)
BTW2: something like add_to_filelist() (or convert filelist to a class
and use filelist.add()) would be even better - add_to_filelist() is easy
to implement (more or less - it seems the various parts of a profile
have different nesting depth), converting to a class is a bit more work.
(Opinions? Volunteers?)
BTW3: It seems the reporter found another crash after fixing this one.
That will be another patch ;-)
=== modified file 'utils/apparmor/aa.py'
--- utils/apparmor/aa.py 2014-04-26 11:05:55 +0000
+++ utils/apparmor/aa.py 2014-05-19 01:02:56 +0000
@@ -583,7 +583,8 @@
if not filelist.get(file, False):
filelist[file] = hasher()
filelist[file]['include']['tunables/global'] = True
- filelist[file]['profiles'][pname] = True
+ filelist[file]['profiles'][pname] = hasher()
+ filelist[file]['profiles'][pname][pname] = True
write_profile_ui_feedback(pname)
def get_profile_flags(filename, program):
Regards,
Christian Boltz
--
> Feel free to close this bug as accidently ;-) fixed...
Nothing happens here by accident ;-)...
[> Christian Boltz and Stephan Binner,
https://bugzilla.novell.com/show_bug.cgi?id=433239]
More information about the AppArmor
mailing list