[apparmor] [patch] Let the parser reject ambiguous unit 'm' for rlimit rttime

Christian Boltz apparmor at cboltz.de
Thu Jul 9 20:23:43 UTC 2015


Hello,

Am Donnerstag, 9. Juli 2015 schrieb John Johansen:
> v2
> move convert_time_units to parser_misc.c and add unit tests
> add "sec" abreviation of secons
> optionally allow whitespace between rlimit value and unit
> allow time the unit to be optional, but output a warning
> update man page to add a note about 'cpu' using units >= seconds
> fix "else" error by using else if (tmp < 0)
> fix "weekss"
> 
> ---
> 
> commit 5ee47621cc28b745d508b0c69046ce1b3776f8b4
> Author: John Johansen <john.johansen at canonical.com>
> Date:   Thu Jun 18 02:22:42 2015 -0700
> 
>     fix: rlimit unit parsing for time
>     
>     currently the parser supports ambiguous units like m for time,
>     which could mean minutes or milliseconds. Fix this and refactor
> the time parsing into a single routine.
>     
>     Signed-off-by: John Johansen <john.johansen at canonical.com>
> 
> diff --git a/parser/apparmor.d.pod b/parser/apparmor.d.pod
> index 93ea835..4b089a8 100644
> --- a/parser/apparmor.d.pod
> +++ b/parser/apparmor.d.pod
...
> +B<RLIMIT TIME> = I<NUMBER> ( 'us' | 'microsecond' | 'microseconds' |
> 'ms' | 'millisecond' | 'milliseconds' | 's' | 'second' | 'seconds' |
> 'min' | 'minute' | 'minutes' | 'h' | 'hour' | 'hours' | 'day' |
> 'days' | 'week' | 'weeks' ) Only applies to RLIMIT of 'cpu',
> 'rttime'. RLIMIT 'cpu' only allows units >= 'seconds'. 

The code also allows 'sec' and 'd' - please mention them in the manpage.
(Just change your local copy, no need to resend the patch.)

Besides this, the patch looks good.


Regards,

Christian Boltz
-- 
<jospoortvliet> !help warlordfff
<SUSEhelp> jospoortvliet: Sorry, plugin warlordfff does not exist!
[from #opensuse-project]




More information about the AppArmor mailing list