On Mon, Jun 09, 2014 at 08:33:28PM +0200, Christian Boltz wrote: > Hello, > > aa-genprof failed to set /proc/sys/kernel/printk_ratelimit to 0 > (unlimited) because the "if not value:" check matches 0. > > This patch replaces the check with "... is None". > > > === modified file 'utils/aa-genprof' > --- utils/aa-genprof 2014-05-21 19:42:43 +0000 > +++ utils/aa-genprof 2014-06-09 18:31:07 +0000 > @@ -33,7 +33,7 @@ > return value > > def sysctl_write(path, value): > - if not value: > + if value is None: > return > with open(path, 'w') as f_out: > f_out.write(str(value))
Why do we even have the check? Wouldn't it make more sense to throw an error condition if sysctl_write() is being used incorrectly? (either when str(value) blows up, in usual-python-style, or with an explicit check of expected value ranges?) Thanks
signature.asc
Description: Digital signature
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
