From 75e3a212f1280e50df5e1442179fde71c59f9d80 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 11 Oct 2015 20:34:02 +0200 Subject: [PATCH] load_include(): use include_dir_filelist() load_include() used a custom os.listdir call instead of include_dir_filelist() for directory includes, which means it also read skippable files like *.rpmnew or README. (It seems nobody created a README inside an included directory, otherwise we'd have seen a bugreport ;-) This patch changes load_include() to use include_dir_filelist(). This function is used in some more places already and removes skippable files from the file list. Acked-by --- utils/apparmor/aa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index f0174720e..a9424f202 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -4158,7 +4158,7 @@ def load_include(incname): attach_profile_data(include, incdata) #If the include is a directory means include all subfiles elif os.path.isdir(profile_dir + '/' + incfile): - load_includeslist += list(map(lambda x: incfile + '/' + x, os.listdir(profile_dir + '/' + incfile))) + load_includeslist += include_dir_filelist(profile_dir, incfile) else: raise AppArmorException("Include file %s not found" % (profile_dir + '/' + incfile) )