[apparmor] [patch] better error message in aa.py when reaching EOF unexpectedly

Christian Boltz apparmor at cboltz.de
Sun Aug 24 14:22:53 UTC 2014


Hello,

when reaching EOF while still in a profile (syntax-wise), there are two
possible reasons:
- missing "}"
- missing "," in the last rule (which means that, thanks to multiline 
  rule handling, the "}" is considered to be part of the last rule)

This patch improves the error message in aa.py to cover a missing ","


=== modified file 'utils/apparmor/aa.py'
--- utils/apparmor/aa.py        2014-08-17 16:16:33 +0000
+++ utils/apparmor/aa.py        2014-08-24 14:17:29 +0000
@@ -3189,7 +3200,7 @@
 
     # End of file reached but we're stuck in a profile
     if profile and not do_include:
-        raise AppArmorException(_("Syntax Error: Missing '}' . Reached end of file %s  while inside profile %s") % (file, profile))
+        raise AppArmorException(_("Syntax Error: Missing '}' or ','. Reached end of file %s while inside profile %s") % (file, profile))
 
     return profile_data
 


Regards,

Christian Boltz
-- 
Jetzt kriege ich es echt mit der Angst: da gibt es Zeilen in meinem
Code der identisch mit dem von SCO ist, etwa ein "include <stdio.h>"
oder aber auch ein hinterlistiges "default:break;".
[Michael Karges in suse-linux]




More information about the AppArmor mailing list