From 5173ef4080b384dfe0dae40d923624285b1f4f12 Mon Sep 17 00:00:00 2001 From: mikeh Date: Thu, 16 Aug 2001 14:23:59 +0000 Subject: [PATCH] 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 --- usr.sbin/cron/lib/entry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/cron/lib/entry.c b/usr.sbin/cron/lib/entry.c index 9e8ed7d79561..2b886eea15f9 100644 --- a/usr.sbin/cron/lib/entry.c +++ b/usr.sbin/cron/lib/entry.c @@ -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)) {