[apparmor] [patch] remove unused code from load_include()

Christian Boltz apparmor at cboltz.de
Sun Sep 13 16:30:49 UTC 2015


Hello,

$subject ;-)

load_include() has a "if not incdata:" block which would be entered if
parse_profile_data() returns None. However, parse_profile_data() always
returns a hasher with [incfile][incfile] = profile_storage(), so that
"if not incdata:" never matches.


[ 89-remove-unused-code-in-load_include.diff ]

--- utils/apparmor/aa.py        2015-09-13 18:10:55.930766712 +0200
+++ utils/apparmor/aa.py        2015-09-13 18:12:58.424615400 +0200
@@ -4160,12 +4162,6 @@
         elif os.path.isfile(profile_dir + '/' + incfile):
             data = get_include_data(incfile)
             incdata = parse_profile_data(data, incfile, True)
-            #print(incdata)
-            if not incdata:
-                # If include is empty, simply push in a placeholder for it
-                # because other profiles may mention them
-                incdata = hasher()
-                incdata[incname] = hasher()
             attach_profile_data(include, incdata)
         #If the include is a directory means include all subfiles
         elif os.path.isdir(profile_dir + '/' + incfile):


Regards,

Christian Boltz
-- 
Wenn ich das Ding entweder im Griff oder an die Wand genagelt habe
melde ich mich auf alle Fälle nochmal;)   [BehrensM in dovecot-de]




More information about the AppArmor mailing list