[apparmor] [patch] fix error handling in aa-decode
Christian Boltz
apparmor at cboltz.de
Sun Sep 16 23:00:56 UTC 2012
Hello,
# aa-decode foobar
String should only contain hex characters (0-9, a-f, A-F)
/usr/sbin/aa-decode: Zeile 53: return: can only `return' from a function or sourced script
The first part of the error message is expected with a non-hex
parameter, the second part isn't ;-)
The following patch fixes it:
=== modified file 'utils/aa-decode'
--- utils/aa-decode 2010-01-12 13:19:20 +0000
+++ utils/aa-decode 2012-09-16 22:51:58 +0000
@@ -50,7 +50,7 @@
e=`echo "$1" | tr -s '[:lower:]' '[:upper:]'`
if ! echo "$e" | egrep -q "^[0-9A-F]+$" ; then
echo "String should only contain hex characters (0-9, a-f, A-F)"
- return
+ exit 1
fi
d=`decode $e`
Regards,
Christian Boltz
--
> ich mochte gerne fur eine unbestimte Zeit Linux von meiner
> Festplatte werfen wie mache ich das genau? [Glenn Charpantier]
Nimm die Platte aus dem Rechner, und pack sie ganz fest mit der Hand.
Dann machst Du eine heftige Wurfbewegung, als wolltest Du die Platte
ganz weit weg werfen. [...] Wenn die Bewgeung heftig genug war, ist
Linux nun von der Platte gefallen. [Adalbert Michelic in suse-linux]
More information about the AppArmor
mailing list