Hello, Am Montag, 24. Februar 2014 schrieb Steve Beattie: > This patch fixes up the parser command invocation via > apparmor/common.py:cmd(), as it handles stdout/stderr redirection, > and the redirection that was being attempted were being handed as > arguments to the parser.
Nice, good catch! > (As an aside, we generally try to avoid invoking the shell when > running external commands, to avoid shell quoting issues.) > > Signed-off-by: Steve Beattie <st...@nxnw.org> > --- > utils/apparmor/tools.py | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > Index: b/utils/apparmor/tools.py > =================================================================== > --- a/utils/apparmor/tools.py > +++ b/utils/apparmor/tools.py > @@ -16,7 +16,7 @@ import sys > > import apparmor.aa as apparmor > import apparmor.ui as aaui > -from apparmor.common import user_perm > +from apparmor.common import user_perm, cmd > > # setup module translations > from apparmor.translations import init_translation > @@ -118,8 +118,7 @@ class aa_tools: > # One simply does not walk in here! > raise apparmor.AppArmorException('Unknown > tool: %s' % self.name) > > - cmd_info = apparmor.cmd([apparmor.parser, > filename, '-I%s' % apparmor.profile_dir, '-R 2>&1', '1>/dev/null']) - > #cmd_info = apparmor.cmd(['cat', filename, '|', > apparmor.parser, '-I%s'%apparmor.profile_dir, '-R 2>&1', > '1>/dev/null']) + cmd_info = cmd([apparmor.parser, > '-I%s' % apparmor.profile_dir, '-R', filename]) > > if cmd_info[0] != 0: > raise apparmor.AppArmorException(cmd_info[1]) Acked-by: Christian Boltz <appar...@cboltz.de> Regards, Christian Boltz -- Früher habe ich auch gerne CDs gekauft [...] Aber ich habe gelernt, daß ich damit nicht Musiker fördere, sondern nur koksende Sony-Spacken, die mir zum Dank für meine Investition [...] ein Rootkit auf meine Karre installieren, gleich neben den Staatstrojaner. [http://blog.koehntopp.de/archives/3154-Nicht-Urheberrecht-ist-das-Kernthema.html] -- AppArmor mailing list AppArmor@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor