1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
From: Christian Kastner <ckk@kvr.at>
Date: Wed, 23 Dec 2015 12:26:33 +0100
Subject: Correct which/how flags are set for entries
In the entry processing code, either set certain internal flags which are
missing, or correct broken settings.
Fix provided by Steve Greenland <stevegr@debian.org>.
Bug-Debian: https://bugs.debian.org/43282
Bug-Debian: https://bugs.debian.org/62141
Bug-Debian: https://bugs.debian.org/84727
Bug-Debian: https://bugs.debian.org/150591
Forwarded: no
Last-Update: 2015-12-20
---
entry.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/entry.c b/entry.c
index e439ae5..84ccac4 100644
--- a/entry.c
+++ b/entry.c
@@ -134,18 +134,21 @@ 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)) {
bit_set(e->minute, 0);
bit_set(e->hour, 0);
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)) {
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);
+ bit_nset(e->dow, 0,0);
} else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) {
bit_set(e->minute, 0);
bit_set(e->hour, 0);
@@ -154,7 +157,7 @@ load_entry(file, error_func, pw, envp)
bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
} else if (!strcmp("hourly", cmd)) {
bit_set(e->minute, 0);
- bit_set(e->hour, (LAST_HOUR-FIRST_HOUR+1));
+ bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1));
bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1));
bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
|