[apparmor] [patch] aa-genprof: fix last_audit_entry_time()

Christian Boltz apparmor at cboltz.de
Wed Mar 19 21:44:16 UTC 2014


Hello,

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).

Needless to say - I verified that logmark really contains the timestamp
from audit.log.


=== modified file 'utils/aa-genprof'
--- utils/aa-genprof    2014-03-06 18:22:26 +0000
+++ utils/aa-genprof    2014-03-19 21:37:41 +0000
@@ -39,10 +39,10 @@
         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


Regards,

Christian Boltz
-- 
> wie gefährlich kann der momentan umgehende Wurm Sober-C für ein
> Linux Betriebssystem werden?
Dass die Leitung durch Mails abholen so ausgelasetet ist, dass Du
das surfen knicken kannst ;-)
[> Oliver Wirthwein und Andreas Winkelmann in suse-linux]




More information about the AppArmor mailing list