Fix the @monthly and @weekly shortcuts so that they actually run

monthly and weekly, respectively. Also fix the @yearly shortcut so
that it doesn't execute daily during January. OpenBSD and NetBSD also
appear to have this bug.

PR:		bin/21152
This commit is contained in:
Mike Heffner 2001-08-16 14:23:59 +00:00
parent f1845f5ba8
commit 93cbb1d1cc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81778

View File

@ -156,6 +156,7 @@ load_entry(file, error_func, pw, envp)
bit_set(e->dom, 0);
bit_set(e->month, 0);
bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
e->flags |= DOW_STAR;
} else if (!strcmp("monthly", cmd)) {
Debug(DPARS, ("load_entry()...monthly shortcut\n"))
bit_set(e->minute, 0);
@ -163,11 +164,13 @@ load_entry(file, error_func, pw, envp)
bit_set(e->dom, 0);
bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
e->flags |= DOW_STAR;
} else if (!strcmp("weekly", cmd)) {
Debug(DPARS, ("load_entry()...weekly shortcut\n"))
bit_set(e->minute, 0);
bit_set(e->hour, 0);
bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1));
e->flags |= DOM_STAR;
bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
bit_set(e->dow, 0);
} else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) {