2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

load_include(): avoid loading directory includes multiple times

The "already loaded?" check in load_include() was done at the beginning
of the function, before entering the loop and before the individual
files of directory includes were added to the filelist. This resulted in
a (wrong) "Conflicting profiles" error for directory includes.

This patch moves the "alreay loaded?" check inside the loop, so that
it's executed for all files, including those of directory includes.


Acked-by <timeout>
This commit is contained in:
Christian Boltz
2015-10-11 20:30:26 +02:00
parent 06885e9377
commit b6fc279676

View File

@@ -4148,11 +4148,11 @@ def include_dir_filelist(profile_dir, include_name):
def load_include(incname):
load_includeslist = [incname]
if include.get(incname, {}).get(incname, False):
return 0
while load_includeslist:
incfile = load_includeslist.pop(0)
if os.path.isfile(profile_dir + '/' + incfile):
if include.get(incfile, {}).get(incfile, False):
pass # already read, do nothing
elif os.path.isfile(profile_dir + '/' + incfile):
data = get_include_data(incfile)
incdata = parse_profile_data(data, incfile, True)
#print(incdata)