From d7aa59110204f2b1bf39712336d750518d79cb11 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 11 May 2020 20:57:11 +0200 Subject: [PATCH] dstcheck: do nothing if clock is clearly in the past. Fixes #15855 Change-Id: I0a08863fa81ef96b16543d28d7e95731f34f60ea Reviewed-on: https://review.haiku-os.org/c/haiku/+/2684 Reviewed-by: waddlesplash --- src/bin/dstcheck.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/dstcheck.cpp b/src/bin/dstcheck.cpp index 30281e33c4..01ceab5696 100644 --- a/src/bin/dstcheck.cpp +++ b/src/bin/dstcheck.cpp @@ -107,6 +107,12 @@ main(int argc, char **argv) time(&t); localtime_r(&t, &tm); + if (tm.tm_year < (2020 - 1900)) { + fprintf(stderr, "%s: not checking because clock is not set.\n", + argv[0]); + exit(1); + } + char path[B_PATH_NAME_LENGTH]; if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, true, path, B_PATH_NAME_LENGTH) != B_OK) {