[apparmor] [patch] common.py: add debugging, py2 compat fix

Christian Boltz apparmor at cboltz.de
Mon Feb 24 18:58:57 UTC 2014


Hello,

this patch fixes two (unrelated) issues in common.py:
- it adds some debug logging in valid_path()
- it fixes a py2 incompability in DebugLogger.__init__


=== modified file 'utils/apparmor/common.py'
--- utils/apparmor/common.py    2014-02-12 23:54:00 +0000
+++ utils/apparmor/common.py    2014-02-24 18:55:21 +0000
@@ -112,6 +112,7 @@
         return False
 
     if '"' in path:  # We double quote elsewhere
+        debug("%s (contains quote)" % (m))
         return False
 
     try:
@@ -228,7 +229,7 @@
             try:
                 logging.basicConfig(filename=self.logfile, level=self.debug_level,
                                     format='%(asctime)s - %(name)s - %(message)s\n')
-            except OSError:
+            except IOError:
                 # Unable to open the default logfile, so create a temporary logfile and tell use about it
                 import tempfile
                 templog = tempfile.NamedTemporaryFile('w', prefix='apparmor', suffix='.log', delete=False)


Regards,

Christian Boltz
-- 
*pieps* Die Verkehrshinweise: Im Netzwerkkabel von Marc 100 MB Stau
wegen einer Vollsperrung der Ausfahrt Festplatte. Bitte warten Sie auf
dem Rasthof FTP-Server. *pieps*
[Christian Boltz, gefunden von D. Haller]




More information about the AppArmor mailing list