logparser.py hashlog: rename 'path' to 'file'

... which is the name we use everywhere else.

With this, we can drop the special casing for 'path' in aa.py
collapse_hashlog.
This commit is contained in:
Christian Boltz 2024-08-12 21:34:25 +02:00
parent 8f7da77142
commit 1d5fc6f2a6
Failed to generate hash of commit
2 changed files with 3 additions and 7 deletions

View file

@ -1600,11 +1600,7 @@ def collapse_log(hashlog, ignore_null_profiles=True):
log_dict[aamode][final_name] = ProfileStorage(profile, hat, 'collapse_log()')
for ev_type, ev_class in ReadLog.ruletypes.items():
if ev_class == FileRule: # TODO: fix the name in the hashlog for FileRule
ev_type_hashlog = 'path'
else:
ev_type_hashlog = ev_type
for event in ev_class.from_hashlog(hashlog[aamode][full_profile][ev_type_hashlog]):
for event in ev_class.from_hashlog(hashlog[aamode][full_profile][ev_type]):
if not hat_exists or not is_known_rule(aa[profile][hat], ev_type, event):
log_dict[aamode][final_name][ev_type].add(event)

View file

@ -82,8 +82,8 @@ class ReadLog:
'change_profile': {}, # flat, no hasher needed (at least in logparser which doesn't support EXEC MODE and EXEC COND)
'dbus': hasher(),
'exec': hasher(),
'file': hasher(),
'network': hasher(),
'path': hasher(),
'pivot_root': hasher(),
'ptrace': hasher(),
'signal': hasher(),
@ -337,7 +337,7 @@ class ReadLog:
return
elif self.op_type(e) == 'file':
FileRule.hashlog_from_event(self.hashlog[aamode][full_profile]['path'], e)
FileRule.hashlog_from_event(self.hashlog[aamode][full_profile]['file'], e)
elif e['operation'] == 'capable':
CapabilityRule.hashlog_from_event(self.hashlog[aamode][full_profile]['capability'], e)