[apparmor] [patch] fix disabling printk_ratelimit in aa-genprof
Steve Beattie
steve at nxnw.org
Mon Jun 9 21:23:49 UTC 2014
On Mon, Jun 09, 2014 at 09:05:58PM +0200, Christian Boltz wrote:
> Hallo Leute,
>
> Am Montag, 9. Juni 2014 schrieb Christian Boltz:
> > However, a warning can't hurt. Slightly updated patch:
>
> Well, actually it can hurt - if you don't import the warn() function ;-)
>
> So here's v3:
Acked-by: Steve Beattie <steve at nxnw.org>. Thanks.
(Oddly, I though one of pyflakes or pep8 would warn about tests like
this, but that doesn't seem to be the case.)
> === modified file 'utils/aa-genprof'
> --- utils/aa-genprof 2014-05-21 19:42:43 +0000
> +++ utils/aa-genprof 2014-06-09 19:04:51 +0000
> @@ -21,6 +21,7 @@
>
> import apparmor.aa as apparmor
> import apparmor.ui as aaui
> +from apparmor.common import warn
>
> # setup module translations
> from apparmor.translations import init_translation
> @@ -33,7 +34,8 @@
> return value
>
> def sysctl_write(path, value):
> - if not value:
> + if value is None:
> + warn('Not writing invalid value "None" to %s'%path)
> return
> with open(path, 'w') as f_out:
> f_out.write(str(value))
>
>
--
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/20140609/e80cc4ce/attachment.pgp>
More information about the AppArmor
mailing list