[apparmor] [patches] parser stress fixups and var support

Steve Beattie steve at nxnw.org
Tue Mar 29 02:42:17 UTC 2011


On Mon, Mar 28, 2011 at 05:05:29PM -0700, Seth Arnold wrote:
> Thanks Steve, a comment:
> 
> +    case rand(50)
> +      when 0
> +        out = "#{out}/@{#{symtab.get_symbol}}"
> +      when 1..4
> +        out = "#{out}/#{get_random_regex}"
> +      when 2..49
> +        out = "#{out}/#{get_random_name(rand(10) + 4)}"
> 
> The second and third cases overlap. Because '..' is inclusive, and
> '...' is exclusive on the upper element, I suggest:

Doh!

> when 0
>   #random symbol
> when 1...4
>   #random regex
> when 4...50
>  #random name

Yep, that's exactly what I was going for. So much for late-night
attempts to fine-tune the chance that each would be generated. Thanks
for the review!

-- 
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: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20110328/aaa0bf16/attachment.pgp>


More information about the AppArmor mailing list