gentoo-overlay/sys-apps/systemd/files/0031-os-util-Handle-negativ...

34 lines
1.3 KiB
Diff
Raw Permalink Normal View History

From 571037f7f86f2bd4a68a28aa19cb3aadaaacd75b Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 18 Aug 2024 03:18:29 -0500
Subject: [PATCH 31/34] os-util: Handle negative time_t values properly
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
musl's time framework happily accepts dates before 1970, which can
result in negative time_t values being returned. These should still be
considered as invalid dates for OS support.
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
src/basic/os-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/basic/os-util.c b/src/basic/os-util.c
index 79f641b36474..8da1c012a223 100644
--- a/src/basic/os-util.c
+++ b/src/basic/os-util.c
@@ -460,7 +460,7 @@ int os_release_support_ended(const char *support_end, bool quiet, usec_t *ret_eo
"Failed to parse SUPPORT_END= in os-release file, ignoring: %m");
time_t eol = timegm(&tm);
- if (eol == (time_t) -1)
+ if (eol <= (time_t) -1)
return log_full_errno(quiet ? LOG_DEBUG : LOG_WARNING, SYNTHETIC_ERRNO(EINVAL),
"Failed to convert SUPPORT_END= in os-release file, ignoring: %m");
--
2.41.0