[apparmor] [patch] better error message in aa.py when reaching EOF unexpectedly

Kshitij Gupta kgupta8592 at gmail.com
Mon Aug 25 18:05:29 UTC 2014


Hello,

On Sunday, August 24, 2014 04:22:53 PM Christian Boltz wrote:
> Hello,
> 
> when reaching EOF while still in a profile (syntax-wise), there are two
> possible reasons:
> - missing "}"
> - missing "," in the last rule (which means that, thanks to multiline
>   rule handling, the "}" is considered to be part of the last rule)
> 
> This patch improves the error message in aa.py to cover a missing ","
> 
> 
> === modified file 'utils/apparmor/aa.py'
> --- utils/apparmor/aa.py        2014-08-17 16:16:33 +0000
> +++ utils/apparmor/aa.py        2014-08-24 14:17:29 +0000
> @@ -3189,7 +3200,7 @@
> 
>      # End of file reached but we're stuck in a profile
>      if profile and not do_include:
> -        raise AppArmorException(_("Syntax Error: Missing '}' . Reached end
> of file %s  while inside profile %s") % (file, profile)) +        raise
> AppArmorException(_("Syntax Error: Missing '}' or ','. Reached end of file
> %s while inside profile %s") % (file, profile))
> 
>      return profile_data
> 
> 
Thanks for improving the message, you'll also have to update the same in 
translation sources. ;-)

Acked-by: Kshitij Gupta <kgupta8592 at gmail.com>.

Regards,

Kshitij Gupta

> 
> Regards,
> 
> Christian Boltz




More information about the AppArmor mailing list