File: Check_for_timezone_changes.patch

package info (click to toggle)
cron 3.0pl1-162
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,204 kB
  • sloc: ansic: 47,007; perl: 733; makefile: 429; sh: 425; python: 36
file content (25 lines) | stat: -rw-r--r-- 975 bytes parent folder | download
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
if the timezone for a system is changed while cron is running,
and the timezone change is _not_ due to a DST event, cron is unaware of
the change and will continue using the old `GMToff` value until it is
restarted.

This patch checks for the timezone unconditionnaly

See bug #1019716: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019716
Index: cron/cron.c
===================================================================
--- cron.orig/cron.c
+++ cron/cron.c
@@ -371,10 +371,11 @@ set_time(int initialize)
     StartTime = time(NULL);
 
     /* We adjust the time to GMT so we can catch DST changes. */
+    /* fix for #1019716: calling get_gmtoff(&StartTime, &tm) in any case */
     tm = *localtime(&StartTime);
+    GMToff = get_gmtoff(&StartTime, &tm);
     if (initialize || tm.tm_isdst != isdst) {
        isdst = tm.tm_isdst;
-       GMToff = get_gmtoff(&StartTime, &tm);
        Debug(DSCH, ("[%d] GMToff=%ld\n",
            getpid(), (long)GMToff))
     }