diff options
-rw-r--r-- | src/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -209,6 +209,15 @@ int main(int argc, char* argv[]) { if((now - lastlogin) > threshold) { printf("You're dead!\n"); exec_cmd(cmd); + } else if((lastlogin - now) > -86400) { + // Abort if last login is too far in the future. + // This should account for when + printf( + "Error: Last login appears to be over one day in the future.\n" + "This likely means something has gone wrong with the system clock.\n" + "Unable to determine current time. Aborting terminus check.\n" + ); + return 2; } else { if(write_lastlogin(lastlogin_path) == 1) { printf("Failure writing lastlogin\n"); |