[Freeipa-devel] [SSSD] Proposed changes to the HBAC grammar

Dmitri Pal dpal at redhat.com
Mon Nov 22 17:22:32 UTC 2010


Stephen Gallagher wrote:
> I have updated the grammar page at
> https://fedorahosted.org/sssd/wiki/HBAC_Grammar again.
>
> The main changes made are these:
>
>  * Eliminate the arbitrary "singular" from monthly repetitions
>  * Add negative numbers for days of the month for counting from the end
>  * For readability, replaced "-" with "and" for "between DAY and DAY"
>  * For readability, added delimiter "at" before the range-specifier
>
> Please reread the page for more detail.
>
I have to comment on many things with the current state of grammar so
for easier reference I copied it here and commented inline

>timerange = Absolute / Periodic
>
>Absolute = "absolute" WSP generalizedTime WSP "~" WSP generalizedTime 
>
>generalizedTime as defined in RFC 4517 section 3.3.13 but without time zone at the end.
>
>Periodic = "periodic" WSP Yearly / Monthly / Weekly / Daily
>
>Yearly = "yearly" WSP Y-specifier WSP range-specified
>
>Monthly = "monthly" WSP M-specifier WSP range-specifier
>
>Weekly = "weekly" WSP W-specifier WSP range-specifier
>
>Daily = "daily" WSP range-specifier
>
>Y-specifier = Y-month / Y-week / Y-day
>
>Y-month = "month" WSP month-number WSP M-specifier
>
>Y-week = "week" WSP week-of-the-year WSP W-specifier
>
>Y-day = "day" WSP day-of-the-year
>
>M-specifier = M-on / M-day

If we read grammar so far we will end up with the following uses of the M-specifier

periodic monthly <M-specifier> <range>
periodic yearly month 1,4,7 <M-specifier> <range>

So far so good.
Now we have two variants of the M-specifier M-on and M-day

>M-on = "on" WSP day-of-the-week WSP day-of-the-month-range

The intent of this one was to be able to specify the weekday within a month

>M-day = "day" WSP day-of-the-month-interval

This one for calendar days within a month 

>W-specifier = "day" WSP day-of-the-week
>
>month-number = interval 1-12
>
>week-of-the-year = interval 1-52
>
>septet-of-the-month = interval 1-5

The septet is not used any more and should be removed, right?

>day-of-the-month-interval = interval day-of-the-month

This should be a plain interval from 1-31 with no negatives since it is used in the M-day rule 
I would argue that M-day can be just replaced with

M-day = "day" WSP interval 1-31

Keep in mind that definition of the interval here is as described below: 
interval XX-YY = a comma-separated list of items from XX to YY, or dash-separated ranges.
For example, (interval 1-31) 3-7,10,12,15,25-31 with no spaces inside.

So definition of the day-of-the-month-interval can be then removed.

>day-of-the-month-range = "between" WSP day-of-the-month WSP "and" WSP day-of-the-month
>
>day-of-the-month = "-31" to "31"


This notion allows me to enter "between -31 and 3" which does not make any sense.
Also current grammar does not allow me to use ranges which I want to use here.
I want to be able to express "Wednesday" of the first and third week of the month. Capability to do so it completely lost.
We abandoned the term "septet" not because of the bad idea but because this is a confusing word. But we can leave without it as long as I can use complex intervals.
After more thinking I would like to reject idea of the negative numbers.
Instead we can do the following:


M-on = "on" WSP day-of-the-week WSP "during" WSP day-of-the-month-range
day-of-the-month-range = interval 1-31 / last-days
last-days = "last" WSP sequential-days
sequential-days = single number from the 1-31 range

So if we want to say "Wednesday" of the first and third week of the month I will use:

periodic monthly on Wed during 1-7,15-21

if I want to say Wednesday during last two weeks of the month I will say:

periodic monthly on Wed during last 14

IMO it is cleaner and simpler and allows to express all the notions we want to express. 
 


>day-of-the-week = interval 1-7 (or Mon-Sun)
>
>range-specifier = "at" WSP HHMM WSP "+" WSP duration-specifier

What is the value and significance of the "+" here? Is it just for readability? Then I would suggest that we replace it with the word "for".

>duration-specifier = DDHHMM
>
>DD = "00" to "31"
>
>HH = "00" to "23"
>
>MM = "00" to "59"
>
>
>interval XX-YY = a comma-separated list of items from XX to YY, or dash-separated ranges.
>range = dash-separated range

This definition seems incomplete but I do not know how to make it better...

>For example, (interval 1-31) 3-7,10,12,15,25-31 with no spaces inside.


Thank you,
Dmitri Pal

Sr. Engineering Manager IPA project,
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/




More information about the Freeipa-devel mailing list