[apparmor] [patch][utils] Fix comment writing

Kshitij Gupta kgupta8592 at gmail.com
Sun Mar 16 14:49:53 UTC 2014


Hello,

Incase, of multiple profiles in a file the same comment was incorrectly
added to all profiles. This patch ensures the correct comments are drawn
for each profile being written.

Fix comment when multiple profiles in a single file.

Signed-off-by: Kshitij Gupta <kgupta8592 at gmail.com>

=== modified file 'utils/apparmor/aa.py'
--- utils/apparmor/aa.py    2014-03-07 18:04:57 +0000
+++ utils/apparmor/aa.py    2014-03-16 14:43:03 +0000
@@ -3451,7 +3451,7 @@
     for prof in sorted(filelist[prof_filename]['profiles'].keys()):
         if prof != name:
             if original_aa[prof][prof].get('initial_comment', False):
-                comment = profile_data[name]['initial_comment']
+                comment = original_aa[prof][prof]['initial_comment']
                 comment.replace('\\n', '\n')
                 data += [comment + '\n']
             data += write_piece(original_aa[prof], 0, prof, prof,
include_flags)




Regards,

Kshitij Gupta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140316/3775beed/attachment.html>


More information about the AppArmor mailing list