From 8b2dcbbd000c5fb9390d4eef6c65490a42e951bd Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 6 Jul 2022 14:38:23 +0900 Subject: [PATCH 1/2] Revert "dissect: ID from os-release should be non-empty, not just non-NULL" This reverts commit a2cf73f0b602a93a32107cfc066a5e307263c577. This is not necessary after 78ab2b5064a0f87579ce5430f9cb83bba0db069a. Addresses https://github.com/systemd/systemd/pull/23454#discussion_r913611798. --- src/shared/dissect-image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 68f7912674..07ec7b7776 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -3217,7 +3217,7 @@ int verity_dissect_and_mount( * First, check the distro ID. If that matches, then check the new SYSEXT_LEVEL value if * available, or else fallback to VERSION_ID. If neither is present (eg: rolling release), * then a simple match on the ID will be performed. */ - if (!isempty(required_host_os_release_id)) { + if (required_host_os_release_id) { _cleanup_strv_free_ char **extension_release = NULL; r = load_extension_release_pairs(dest, dissected_image->image_name, &extension_release); From d30d86b7ed19e18218a31237fcc56bf441a4d43e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 6 Jul 2022 19:16:24 +0900 Subject: [PATCH 2/2] dissect: refuse empty release ID --- src/shared/dissect-image.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 07ec7b7776..c7a336d432 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -3220,6 +3220,8 @@ int verity_dissect_and_mount( if (required_host_os_release_id) { _cleanup_strv_free_ char **extension_release = NULL; + assert(!isempty(required_host_os_release_id)); + r = load_extension_release_pairs(dest, dissected_image->image_name, &extension_release); if (r < 0) return log_debug_errno(r, "Failed to parse image %s extension-release metadata: %m", dissected_image->image_name);