[apparmor] patch for aa-logprof -f given a special file

Steve Beattie steve at nxnw.org
Tue Nov 4 20:52:45 UTC 2014


On Tue, Nov 04, 2014 at 03:15:40PM -0500, Peter Maloney wrote:
> The perl tools allowed using aa-logprof -f <(...), but the python ones
> don't. I find it very useful to use with grep to shorten the list of
> questions for modifying a specific profile, without bothering with
> updating other profiles with lots of spam you don't care about. And in
> this particular case I was using head to try to find out which line
> somewhere makes aa-logprof crash with another problem I'm working on.
> 
> Would you please accept this patch to change it so it will allow special
> files again?

Ah yep, that's a good catch. Thanks, I'll apply it.

> root at vpn3:~# aa-logprof -f <(head /var/log/audit/audit.log)
> Traceback (most recent call last):
>   File "/usr/sbin/aa-logprof", line 37, in <module>
>     raise apparmor.AppArmorException(_('The logfile %s does not exist. Please check the path') % filename)
> apparmor.common.AppArmorException: 'The logfile /dev/fd/63 does not exist. Please check the path'
> 
> 
> root at vpn3:~# diff -u /usr/sbin/aa-logprof{.orig,}
> --- /usr/sbin/aa-logprof.orig   2014-11-04 20:41:51.689136187 +0100
> +++ /usr/sbin/aa-logprof        2014-11-04 20:42:06.665135040 +0100
> @@ -33,7 +33,7 @@
>  
>  
>  if filename:
> -    if not os.path.isfile(filename):
> +    if not os.path.exists(filename):
>          raise apparmor.AppArmorException(_('The logfile %s does not exist. Please check the path') % filename)
>      else:
>          apparmor.filename = filename
> 
> 
> root at vpn3:~# aa-logprof -f <(head /var/log/audit/audit.log)
> Reading log entries from /dev/fd/63.
> Updating AppArmor profiles in /etc/apparmor.d.
> ...
> 

-- 
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: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20141104/246026f2/attachment.pgp>


More information about the AppArmor mailing list