[apparmor] [patch] cleanup superfluous variable assignments in aa-mergeprof

Christian Boltz apparmor at cboltz.de
Sun May 24 11:43:42 UTC 2015


Hello,

aa-mergeprof has some sections where it first resets the 'deleted'
variable, and then overwrites it again a line or two later.
This patch removes the superfluous variable resets.


[ 12-mergeprof-cleanup-superfluous-deleted.diff ]

=== modified file utils/aa-mergeprof
--- utils/aa-mergeprof  2015-05-19 01:44:22.206060000 +0200
+++ utils/aa-mergeprof  2015-05-24 13:37:02.384136443 +0200
@@ -372,7 +372,6 @@
                                 selection = options[selected]
                             match = apparmor.aa.re_match_include(selection)
                             if match:
-                                deleted = False
                                 inc = match
                                 deleted = apparmor.aa.delete_duplicates(self.user.aa[profile][hat], inc)
                                 self.user.aa[profile][hat]['include'][inc] = True
@@ -614,7 +613,6 @@
                                 match = apparmor.aa.re_match_include(path)
                                 if match:
                                     inc = match
-                                    deleted = 0
                                     deleted = apparmor.aa.delete_duplicates(self.user.aa[profile][hat], inc)
                                     self.user.aa[profile][hat]['include'][inc] =  True
                                     apparmor.aa.changed[profile] =  True
@@ -788,7 +786,6 @@
                                 done = True
                                 if apparmor.aa.re_match_include(selection): #re.search('#include\s+<.+>$', selection):
                                     inc =  apparmor.aa.re_match_include(selection) #re.search('#include\s+<(.+)>$', selection).groups()[0]
-                                    deleted =  0
                                     deleted = apparmor.aa.delete_duplicates(self.user.aa[profile][hat], inc)
 
                                     self.user.aa[profile][hat]['include'][inc] = True


Regards,

Christian Boltz
-- 
[Antiviren-Software]   D i e   b r a u c h e n    a  l  l  e
Nicht nur aus Gründen der Sicherheit vor Betrügern,
sondern insbesondere als Schutz vor Bankern und Juristen.
[Ernst Scott in opensuse-de]




More information about the AppArmor mailing list