Commit 5f3fc904 authored by Christian Boltz's avatar Christian Boltz

aa-genprof: fix last_audit_entry_time()

last_audit_entry_time() was waiting forever because 
subprocess.check_output() started tail without any parameters.
Fixed by removing shell=True (default is shell=False).

Also fix the regex ("^.*", the dot was missing)
Acked-by: Steve Beattie's avatarSteve Beattie <steve@nxnw.org>
parent 6557090a
......@@ -39,10 +39,10 @@ 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'], shell=True)
out = subprocess.check_output(['tail', '-1', '/var/log/audit/audit.log'])
logmark = None
if re.search('^*msg\=audit\((\d+\.\d+\:\d+).*\).*$', out):
logmark = re.search('^*msg\=audit\((\d+\.\d+\:\d+).*\).*$', out).groups()[0]
if re.search('^.*msg\=audit\((\d+\.\d+\:\d+).*\).*$', out):
logmark = re.search('^.*msg\=audit\((\d+\.\d+\:\d+).*\).*$', out).groups()[0]
else:
logmark = ''
return logmark
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment