mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
Fix wrong usage of write_prof_data in serialize_profile_from_old_profile()
write_prof_data[hat] is correct (it only contains one profile, see bug 1528139), write_prof_data[profile][hat] is not and returns an empty (sub)hasher. This affects RE_PROFILE_START and RE_PROFILE_BARE_FILE_ENTRY. Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for trunk, 2.9 and 2.10
This commit is contained in:
parent
4ae6ad03ba
commit
125dc5fd18
1 changed files with 2 additions and 2 deletions
|
@ -3672,7 +3672,7 @@ def serialize_profile_from_old_profile(profile_data, name, options):
|
|||
if RE_PROFILE_START.search(line):
|
||||
|
||||
(profile, hat, attachment, flags, in_contained_hat, correct) = serialize_parse_profile_start(
|
||||
line, prof_filename, None, profile, hat, write_prof_data[profile][hat]['profile'], write_prof_data[profile][hat]['external'], correct)
|
||||
line, prof_filename, None, profile, hat, write_prof_data[hat]['profile'], write_prof_data[hat]['external'], correct)
|
||||
|
||||
if not write_prof_data[hat]['name'] == profile:
|
||||
correct = False
|
||||
|
@ -3908,7 +3908,7 @@ def serialize_profile_from_old_profile(profile_data, name, options):
|
|||
if matches[0]:
|
||||
audit = mode
|
||||
|
||||
path_rule = write_prof_data[profile][hat][allow]['path'][ALL]
|
||||
path_rule = write_prof_data[hat][allow]['path'][ALL]
|
||||
if path_rule.get('mode', set()) & mode and \
|
||||
(not audit or path_rule.get('audit', set()) & audit) and \
|
||||
path_rule.get('file_prefix', set()):
|
||||
|
|
Loading…
Add table
Reference in a new issue