[apparmor] [patch] fix error handling in aa-decode

Steve Beattie steve at nxnw.org
Mon Sep 17 17:53:27 UTC 2012


On Mon, Sep 17, 2012 at 01:00:56AM +0200, Christian Boltz wrote:
> # 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 ;-)

Bah, yet another behavioral difference between bash and dash.
On 'return', dash happily exits silently and leaves the exit code as 0.

> The following patch fixes it:

Acked-By: Steve Beattie <sbeattie at ubuntu.com>

> > but is anyone else a bit worried about how much
> > handling is done via external programs?
> 
> That's probably caused by the fact that aa-decode is a shell script, not 
> perl.

Patches accepted, though given our recent direction, unmaintainable
python would probably be preferred over unmaintainable perl. :)

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20120917/6b643984/attachment.pgp>


More information about the AppArmor mailing list