[apparmor] [Branch ~apparmor-dev/apparmor/master] Rev 1770: Update apparmor's handling of rlimits for cpu limit and more natural units

Christian Boltz apparmor at cboltz.de
Fri Aug 12 21:40:46 UTC 2011


Hello,

Am Donnerstag, 11. August 2011 schrieb noreply at launchpad.net:
> revno: 1770
> committer: John Johansen <john.johansen at canonical.com>

>   Update apparmor's handling of rlimits for cpu limit and more
> natural units

That looks like I'll have to update apparmor.vim ;-)

>   Allow for rlimit cpu to specified which is now supported by the
> kernel.
>
>   Previously the rlimit units where limited to K, M, G and would fail
> when KB, MB, GB where used.  Allow for both, 

The change for K, M, G is quite obvious - now KB, MB and GB are allowed 
too in profiles.

Are lowercase k, m, g, kb, mb, gb and mixed case (kB, Mb) also allowed?

> also allow for units on
> lengths of time, by specifying "seconds", "minutes", "hours".. or

If I get it right, this only affects the (newly added) "rlimit cpu", right?
Can you give me some sample profile lines for "rlimit cpu"?

> any unique subset eg. "s", "sec", "m", "min", "h", "hour" ..

Does that mean all of the following are valid in a profile?
s
se
sec
seco
secon
second
seconds

Again, are uppercase or mixed-case words allowed? For example
Sec
secoND

I'm not yet sure how I can make a regex of this without breaking vim's
limit on parenthesis - well, s|se|sec|seco would be an option, but if
combined with upper- and lowercase, it would become
    [sS]|[sS][eE]|[sS][eE][cC]|[sS][eE][cC][oO]
which will become unreadable ;-)

> === modified file 'parser/parser_yacc.y'
> +                       const char *seconds = "seconds";
> +                       const char *minutes = "minutes";
> +                       const char *hours = "hours";
> +                       const char *days = "days";

> +                       const char *kb = "KB";
> +                       const char *mb = "MB";
> +                       const char *gb = "GB";
> +

Are these all texts that are allowed for rlimit? Or did I miss something?


Regards,

Christian Boltz
-- 
"Error Message: Your Password Must Be at Least 18770 Characters and
 Cannot Repeat Any of Your Previous 30689 Passwords (Q276304)"
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q276304



More information about the AppArmor mailing list