]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysext: refuse empty release ID to avoid triggering assertion
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 20 May 2022 18:03:21 +0000 (03:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 20 May 2022 21:37:56 +0000 (06:37 +0900)
Otherwise, the assertion in extension_release_validate() will be
triggered.

src/sysext/sysext.c

index 76c2fe69786fe1b5e233ad44100d175c7ac8d7ae..364af195e0dc631c8a48910183cf001a2378d921 100644 (file)
@@ -478,6 +478,10 @@ static int merge_subprocess(Hashmap *images, const char *workspace) {
                         "SYSEXT_LEVEL", &host_os_release_sysext_level);
         if (r < 0)
                 return log_error_errno(r, "Failed to acquire 'os-release' data of OS tree '%s': %m", empty_to_root(arg_root));
+        if (isempty(host_os_release_id))
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "'ID' field not found or empty in 'os-release' data of OS tree '%s': %m",
+                                       empty_to_root(arg_root));
 
         /* Let's now mount all images */
         HASHMAP_FOREACH(img, images) {