mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
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:
parent
8f7da77142
commit
1d5fc6f2a6
2 changed files with 3 additions and 7 deletions
|
@ -1600,11 +1600,7 @@ def collapse_log(hashlog, ignore_null_profiles=True):
|
||||||
log_dict[aamode][final_name] = ProfileStorage(profile, hat, 'collapse_log()')
|
log_dict[aamode][final_name] = ProfileStorage(profile, hat, 'collapse_log()')
|
||||||
|
|
||||||
for ev_type, ev_class in ReadLog.ruletypes.items():
|
for ev_type, ev_class in ReadLog.ruletypes.items():
|
||||||
if ev_class == FileRule: # TODO: fix the name in the hashlog for FileRule
|
for event in ev_class.from_hashlog(hashlog[aamode][full_profile][ev_type]):
|
||||||
ev_type_hashlog = 'path'
|
|
||||||
else:
|
|
||||||
ev_type_hashlog = ev_type
|
|
||||||
for event in ev_class.from_hashlog(hashlog[aamode][full_profile][ev_type_hashlog]):
|
|
||||||
if not hat_exists or not is_known_rule(aa[profile][hat], ev_type, event):
|
if not hat_exists or not is_known_rule(aa[profile][hat], ev_type, event):
|
||||||
log_dict[aamode][final_name][ev_type].add(event)
|
log_dict[aamode][final_name][ev_type].add(event)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
'change_profile': {}, # flat, no hasher needed (at least in logparser which doesn't support EXEC MODE and EXEC COND)
|
||||||
'dbus': hasher(),
|
'dbus': hasher(),
|
||||||
'exec': hasher(),
|
'exec': hasher(),
|
||||||
|
'file': hasher(),
|
||||||
'network': hasher(),
|
'network': hasher(),
|
||||||
'path': hasher(),
|
|
||||||
'pivot_root': hasher(),
|
'pivot_root': hasher(),
|
||||||
'ptrace': hasher(),
|
'ptrace': hasher(),
|
||||||
'signal': hasher(),
|
'signal': hasher(),
|
||||||
|
@ -337,7 +337,7 @@ class ReadLog:
|
||||||
return
|
return
|
||||||
|
|
||||||
elif self.op_type(e) == 'file':
|
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':
|
elif e['operation'] == 'capable':
|
||||||
CapabilityRule.hashlog_from_event(self.hashlog[aamode][full_profile]['capability'], e)
|
CapabilityRule.hashlog_from_event(self.hashlog[aamode][full_profile]['capability'], e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue