core: refuse to mount ExtensionImages if the base layer doesn't at least have ID...
authorLuca Boccassi <luca.boccassi@microsoft.com>
Wed, 19 Jan 2022 00:08:57 +0000 (00:08 +0000)
committerLuca Boccassi <bluca@debian.org>
Tue, 15 Feb 2022 01:13:47 +0000 (01:13 +0000)
We can't match an extension if we don't at least have an ID,
so refuse to continue

(cherry picked from commit 78ab2b5064a0f87579ce5430f9cb83bba0db069a)
(cherry picked from commit 179bd47f04c538ed1f2c1de2cf2c18f17b027a51)

src/core/namespace.c

index b933d46cf6cdbde18a57593c7e11e19b0f2c8b01..e3aebe8b5e8371e1424884d960062663dd3cb540 100644 (file)
@@ -1151,6 +1151,8 @@ static int mount_image(const MountEntry *m, const char *root_directory) {
                                 NULL);
                 if (r < 0)
                         return log_debug_errno(r, "Failed to acquire 'os-release' data of OS tree '%s': %m", empty_to_root(root_directory));
+                if (isempty(host_os_release_id))
+                        return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "'ID' field not found or empty in 'os-release' data of OS tree '%s': %m", empty_to_root(root_directory));
         }
 
         r = verity_dissect_and_mount(