diff options
author | mikeh <mikeh@FreeBSD.org> | 2001-08-16 14:23:59 +0000 |
---|---|---|
committer | mikeh <mikeh@FreeBSD.org> | 2001-08-16 14:23:59 +0000 |
commit | 5173ef4080b384dfe0dae40d923624285b1f4f12 (patch) | |
tree | 26931d23b64289fc5cc36e040e3365c2b17875b0 | |
parent | b8156781f00b6d334c40436153483e05ac6a96d4 (diff) | |
download | FreeBSD-src-5173ef4080b384dfe0dae40d923624285b1f4f12.zip FreeBSD-src-5173ef4080b384dfe0dae40d923624285b1f4f12.tar.gz |
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
-rw-r--r-- | usr.sbin/cron/lib/entry.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/cron/lib/entry.c b/usr.sbin/cron/lib/entry.c index 9e8ed7d..2b886ee 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)) { |