From: Tomas Mraz Date: Wed, 9 Mar 2011 07:37:38 +0000 (+0100) Subject: Safeguard for system time changes. Otherwise anacron might wait with the job X-Git-Tag: cronie1.4.7~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21016ea2497f17bcab8920fee9c84a22c3b5a1df;p=cronie Safeguard for system time changes. Otherwise anacron might wait with the job running for a too long time. --- diff --git a/anacron/main.c b/anacron/main.c index 08db810..c1a97e9 100644 --- a/anacron/main.c +++ b/anacron/main.c @@ -384,6 +384,12 @@ time_till(job_rec *jr) tn = time(NULL); tj = start_sec + jr->delay * 60; if (tj < tn) return 0; + if (tj - tn > 3600*24) + { + explain("System time manipulation detected, job `%s' will run immediately", + jr->ident); + return 0; + } return tj - tn; }