[apparmor] [patch] fix aa-autodep (and aa-genprof) to write a non-empty profile

Christian Boltz apparmor at cboltz.de
Wed Feb 26 22:24:36 UTC 2014


Hello,

aa-autodep (and therefore also aa-genprof) created a nearly-empty 
profile files with only tunables/global, but no profile. This patch 
makes sure that the profile itsself is also written to the profile file.

Without the added line, filelist[prof_filename]['profiles'].keys()) in 
serialize_profile was empty, which means the loop that writes the 
profile was never executed.

I think this patch ranks very high on my typing-very-slow list - I 
needed half an hour to hunt the bug down, so I typed about one character 
per minute ;-)


=== modified file 'utils/apparmor/aa.py'
--- utils/apparmor/aa.py        2014-02-25 12:17:46 +0000
+++ utils/apparmor/aa.py        2014-02-26 21:56:37 +0000
@@ -578,6 +578,7 @@
         if not filelist.get(file, False):
             filelist[file] = hasher()
         filelist[file]['include']['tunables/global'] = True
+        filelist[file]['profiles'][pname] = True
     write_profile_ui_feedback(pname)
 
 def get_profile_flags(filename, program):



Regards,

Christian Boltz
-- 
Es ist halt nur nicht eine einzige zentrale Filterdatei. Vorteil ist,
dass die Anwender ihre eigenen Scripte verwalten (und sich dabei in den
Fuss schiessen können). Nachteil ist genau das gleiche. (^-^)
[Sandy Drobic in suse-linux über Sieve]




More information about the AppArmor mailing list