Skip to content

Wrong flag is set for weekly definition #23

@nerg4l

Description

@nerg4l

As far as I know @weekly means 0 0 * * 0

At the moment DOW_STAR flag is set for this definition, but it should be DOM_STAR (M instead of W).

cron/entry.c

Lines 147 to 158 in 3ce0c3a

} else if (!strcmp("weekly", cmd)) {
set_element(e->minute, FIRST_MINUTE, LAST_MINUTE,
FIRST_MINUTE);
set_element(e->hour, FIRST_HOUR, LAST_HOUR,
FIRST_HOUR);
set_range(e->dom, FIRST_DOM, LAST_DOM,
FIRST_DOM, LAST_DOM, 1);
set_range(e->month, FIRST_MONTH, LAST_MONTH,
FIRST_MONTH, LAST_MONTH, 1);
set_element(e->dow, FIRST_DOW, LAST_DOW,
FIRST_DOW);
e->flags |= DOW_STAR;

I noticed the same "bug" in cronie-crond/cronie#52 a few years ago.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions