mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
parse_profile_data(): call load_include() for IncludeRule
rule_obj.get_full_paths() handles directories and non-existing files (depending on 'if exists'), so we can simply feed the resulting list into load_include()
This commit is contained in:
parent
f3f597ff0b
commit
057c916032
1 changed files with 10 additions and 2 deletions
|
@ -1933,10 +1933,18 @@ def parse_profile_data(data, file, do_include):
|
|||
|
||||
# IncludeRule can handle 'include' and 'include if exists' - place it after the "old" 'include' handling so that it only catches 'include if exists' for now
|
||||
elif IncludeRule.match(line):
|
||||
rule_obj = IncludeRule.parse(line)
|
||||
if profile:
|
||||
profile_data[profile][hat]['inc_ie'].add(IncludeRule.parse(line))
|
||||
profile_data[profile][hat]['inc_ie'].add(rule_obj)
|
||||
else:
|
||||
active_profiles.add_inc_ie(file, IncludeRule.parse(line))
|
||||
active_profiles.add_inc_ie(file, rule_obj)
|
||||
|
||||
for incname in rule_obj.get_full_paths(profile_dir):
|
||||
# include[] keys can be a) 'abstractions/foo' and b) '/full/path'
|
||||
if incname.startswith(profile_dir):
|
||||
incname = incname.replace('%s/' % profile_dir, '')
|
||||
|
||||
load_include(incname)
|
||||
|
||||
elif NetworkRule.match(line):
|
||||
if not profile:
|
||||
|
|
Loading…
Add table
Reference in a new issue