mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
fix two issues in aa-genprof's last_audit_entry_time():
- convert "tail" result from byte to string to avoid TypeError crash - use apparmor.filename instead of hardcoded /var/log/audit/audit.log Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
This commit is contained in:
parent
8c28481311
commit
b2c4934bc1
1 changed files with 2 additions and 1 deletions
|
@ -39,8 +39,9 @@ def sysctl_write(path, value):
|
|||
f_out.write(str(value))
|
||||
|
||||
def last_audit_entry_time():
|
||||
out = subprocess.check_output(['tail', '-1', '/var/log/audit/audit.log'])
|
||||
out = subprocess.check_output(['tail', '-1', apparmor.filename])
|
||||
logmark = None
|
||||
out = out.decode('ascii')
|
||||
if re.search('^.*msg\=audit\((\d+\.\d+\:\d+).*\).*$', out):
|
||||
logmark = re.search('^.*msg\=audit\((\d+\.\d+\:\d+).*\).*$', out).groups()[0]
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue