[apparmor] [PATCH 1/8] utils: Improve error messages when profiles/parser is not found

Seth Arnold seth.arnold at canonical.com
Thu Feb 9 00:19:55 UTC 2017


On Wed, Feb 08, 2017 at 10:01:38PM +0000, Tyler Hicks wrote:
> When aa.py is imported, it looks for a set of profiles and it also looks
> for the parser. Both of these paths are configured by logprof.conf but
> it isn't always obvious which logprof.conf file was used and, therefore,
> it isn't always obvious where aa.py is looking. This patch includes the
> paths in the error messages.
> 
> Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
> Cc: Christian Boltz <apparmor at cboltz.de>

Acked-by: Seth Arnold <seth.arnold at canonical.com>
Thanks

> ---
>  utils/apparmor/aa.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py
> index ab7f6c9..eecf8c7 100644
> --- a/utils/apparmor/aa.py
> +++ b/utils/apparmor/aa.py
> @@ -3754,11 +3754,11 @@ if cfg['settings'].get('default_owner_prompt', False):
>  
>  profile_dir = conf.find_first_dir(cfg['settings'].get('profiledir')) or '/etc/apparmor.d'
>  if not os.path.isdir(profile_dir):
> -    raise AppArmorException('Can\'t find AppArmor profiles')
> +    raise AppArmorException('Can\'t find AppArmor profiles in %s' % (profile_dir))
>  
>  extra_profile_dir = conf.find_first_dir(cfg['settings'].get('inactive_profiledir')) or '/usr/share/apparmor/extra-profiles/'
>  
>  parser = conf.find_first_file(cfg['settings'].get('parser')) or '/sbin/apparmor_parser'
>  if not os.path.isfile(parser) or not os.access(parser, os.EX_OK):
> -    raise AppArmorException('Can\'t find apparmor_parser')
> +    raise AppArmorException('Can\'t find apparmor_parser at %s' % (parser))
>  
> -- 
> 2.7.4
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20170208/a6a3b892/attachment-0001.pgp>


More information about the AppArmor mailing list