[apparmor] [patch] Add RlimitRule and RlimitRuleset classes

Steve Beattie steve at nxnw.org
Fri Jun 5 02:25:11 UTC 2015


On Fri, Jun 05, 2015 at 01:31:27AM +0200, Christian Boltz wrote:
> > > BTW: The regex contains '=>' as optional part - is this really
> > > correct?
> > No, not correct, the parser requires the '<='.
> 
> Since this patch touches RE_PROFILE_RLIMIT already, should I change
> 
> +RE_PROFILE_RLIMIT       = re.compile('^\s*set\s+rlimit\s+(?P<rlimit>[a-z]+)\s+(<=)?\s*(?P<value>[^ ]+)' + RE_COMMA_EOL)
>                                                                                ^^^^^
> to
> 
> +RE_PROFILE_RLIMIT       = re.compile('^\s*set\s+rlimit\s+(?P<rlimit>[a-z]+)\s+<=\s*(?P<value>[^ ]+)' + RE_COMMA_EOL)
>                                                                                ^^
> before commiting it?
> 
> I just tested a bit - the whitespace around the arrow is optional, and
> the parser accepts "set rlimit nice<=0,". So the final of the regex 
> would be:
> 
> +RE_PROFILE_RLIMIT       = re.compile('^\s*set\s+rlimit\s+(?P<rlimit>[a-z]+)\s*<=\s*(?P<value>[^ ]+)' + RE_COMMA_EOL)
>                                                                               ^
> 
> So should I change the patch to use the updated regex, or do you want a 
> separate patch for that?

Changing the patch is fine, to the last regex. (I hadn't realized that
the whitespace around <= was entirely optional.)

Thanks.

-- 
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/20150604/d6d1c812/attachment.pgp>


More information about the AppArmor mailing list