[apparmor] [patch] better error messages in aa.py store_list_var()

Christian Boltz apparmor at cboltz.de
Thu Jun 19 00:41:39 UTC 2014


Hello,

this patch improves the error messages in aa.py store_list_var() to make
debugging of profile syntax problems easier.


=== modified file 'utils/apparmor/aa.py'
--- utils/apparmor/aa.py        2014-06-09 22:44:59 +0000
+++ utils/apparmor/aa.py        2014-06-19 00:36:11 +0000
@@ -3245,14 +3245,14 @@
             var[list_var] = set(vlist)
         else:
             #print('Ignored: New definition for variable for:',list_var,'=', value, 'operation was:',var_operation,'old value=', var[list_var])
-            raise AppArmorException(_('An existing variable redefined: %s') % list_var)
+            raise AppArmorException(_('Redefining existing variable %s: %s') % (list_var, value))
     elif var_operation == '+=':
         if var.get(list_var, False):
             var[list_var] = set(var[list_var] + vlist)
         else:
-            raise AppArmorException(_('Values added to a non-existing variable: %s') % list_var)
+            raise AppArmorException(_('Values added to a non-existing variable %s: %s') % (list_var, value))
     else:
-        raise AppArmorException(_('Unknown variable operation: %s') % var_operation)
+        raise AppArmorException(_('Unknown variable operation %s for variable %s') % (var_operation, list_var))
 
 
 def strip_quotes(data):



Regards,

Christian Boltz
-- 
[BILD] Als langjährig tätiger Strafverteidiger (und Fan von Volker
Pispers) muß ich jedoch dringend davor warnen, stinkende tote Fische in
dieses Freiexemplar der sogenannten "Zeitung" einzuwickeln. Weil das ein
Strafverfahren wegen Beleidigung zulasten des Fisches nach sich ziehen
könnte.
[http://www.kanzlei-hoenig.de/2012/keine-stinkende-tote-fische-im-briefkasten/]




More information about the AppArmor mailing list