[apparmor] [patch] fix aa-status to work with non-ascii mountpoints
Christian Boltz
apparmor at cboltz.de
Sun Mar 1 20:19:16 UTC 2015
Hello,
this patch fixes aa-status find_apparmorfs() to work with non-ascii
mountpoints.
(I even made a temporary non-ascii mountpoint to verify it ;-)
Patch by Alain Benedetti
References: https://bugs.launchpad.net/bugs/1310598
I propose this patch for trunk and 2.9.
=== modified file 'utils/aa-status'
--- utils/aa-status 2014-02-14 22:42:19 +0000
+++ utils/aa-status 2015-03-01 20:12:40 +0000
@@ -134,10 +134,10 @@
def find_apparmorfs():
'''Finds AppArmor mount point'''
- for p in open("/proc/mounts").readlines():
- if p.split()[2] == "securityfs" and \
- os.path.exists(os.path.join(p.split()[1], "apparmor")):
- return os.path.join(p.split()[1], "apparmor")
+ for p in open("/proc/mounts","rb").readlines():
+ if p.split()[2].decode() == "securityfs" and \
+ os.path.exists(os.path.join(p.split()[1].decode(), "apparmor")):
+ return os.path.join(p.split()[1].decode(), "apparmor")
return False
def errormsg(message):
Regards,
Christian Boltz
--
[IP-Adresse von ppp0 mit system() ermitteln]
Dazu Perl zu verwenden, ähnelt sicherlich ein wenig der Spatzenjagd
mit großkalibrigen Langrohrgeschützen...;-)
[Christian Schmidt in suse-linux]
More information about the AppArmor
mailing list