]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
os-util: accept SUPPORT_END= with empty string as explicit way to disable concept
authorLennart Poettering <lennart@poettering.net>
Mon, 23 Jan 2023 12:15:27 +0000 (13:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 24 Jan 2023 14:32:43 +0000 (15:32 +0100)
src/basic/os-util.c

index 3a2e4f59a6981446247716e2538cac4addc6a0ca..3b50279a443a86e2543736dcc993f5c1e422c95a 100644 (file)
@@ -349,14 +349,14 @@ int os_release_support_ended(const char *support_end, bool quiet) {
                 if (r < 0 && r != -ENOENT)
                         return log_full_errno(quiet ? LOG_DEBUG : LOG_WARNING, r,
                                               "Failed to read os-release file, ignoring: %m");
-                if (!_support_end_alloc)
-                        return false;  /* no end date defined */
 
                 support_end = _support_end_alloc;
         }
 
-        struct tm tm = {};
+        if (isempty(support_end)) /* An empty string is a explicit way to say "no EOL exists" */
+                return false;  /* no end date defined */
 
+        struct tm tm = {};
         const char *k = strptime(support_end, "%Y-%m-%d", &tm);
         if (!k || *k)
                 return log_full_errno(quiet ? LOG_DEBUG : LOG_WARNING, SYNTHETIC_ERRNO(EINVAL),