X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Ftimers.c;h=ea97f34629cc5b793fd689e953dcbfeac1576fbd;hp=318a61f47e467ee91e3d45b09177b08ff3f162a9;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c diff --git a/driver/timers.c b/driver/timers.c index 318a61f4..ea97f346 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -1,5 +1,5 @@ /* timers.c --- detecting when the user is idle, and other timer-related tasks. - * xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2017 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -562,6 +562,21 @@ check_pointer_timer (XtPointer closure, XtIntervalId *id) We only do this when we'd be polling the mouse position anyway. This amounts to an assumption that machines with APM support also have /proc/interrupts. + + Now here's a thing that sucks about this: if the user actually changes + the time of the machine, it will either trigger or delay the triggering + of a lock. On most systems, that requires root, but I'll bet at least + some GUI configs let non-root do it. Also, NTP attacks. + + On Linux 2.6.39+ systems, there exists clock_gettime(CLOCK_BOOTTIME) + which would allow us to detect the "laptop CPU had been halted" state + independently of changes in wall-clock time. But of course that's not + portable. + + When the wall clock changes, what do Xt timers do, anyway? If I have + a timer set for 30 seconds from now, and adjust the wall clock +15 seconds, + does the timer fire 30 seconds from now or 15? I actually have no idea. + It does not appear to be specified. */ static void check_for_clock_skew (saver_info *si)