summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index fa89688..372e011 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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");

Generated by cgit