mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
Fix compability with Python < 3.9
str.removeprefix() was introduced in Python 3.9. Replace it with backwards-compatible code.
This commit is contained in:
@@ -191,8 +191,8 @@ class ReadLog:
|
||||
return
|
||||
|
||||
elif e['class'] and e['class'] == 'namespace':
|
||||
if e['denied_mask'].startswith('userns'):
|
||||
self.hashlog[aamode][full_profile]['userns'][e['denied_mask'].removeprefix('userns_')] = True
|
||||
if e['denied_mask'].startswith('userns_'):
|
||||
self.hashlog[aamode][full_profile]['userns'][ e['denied_mask'][7:] ] = True # [7:] removes the 'userns_' prefix
|
||||
return
|
||||
|
||||
elif e['class'] and e['class'].endswith('mqueue'):
|
||||
|
Reference in New Issue
Block a user