mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
local: check offset sanity before accumulation
Don't accept an offset that points to time before 1970 or outside the interval to which is mapped NTP time.
This commit is contained in:
6
rtc.c
6
rtc.c
@@ -93,9 +93,9 @@ fallback_time_init(void)
|
||||
LCL_ReadCookedTime(&now, NULL);
|
||||
|
||||
if (now.tv_sec < buf.st_mtime) {
|
||||
LCL_ApplyStepOffset(now.tv_sec - buf.st_mtime);
|
||||
LOG(LOGS_INFO, LOGF_Rtc,
|
||||
"System clock set from driftfile %s", drift_file);
|
||||
if (LCL_ApplyStepOffset(now.tv_sec - buf.st_mtime))
|
||||
LOG(LOGS_INFO, LOGF_Rtc, "System clock set from driftfile %s",
|
||||
drift_file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user