From 81df5cd1851babec4bf0d7bb0ddb1bdf81676b74 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 29 Sep 2023 18:28:42 +0200 Subject: [PATCH] sysext: validate against the right API level Let's ake sure we check confexts against the confext api level, and sysext against the sysext api level. Previously the test would simply be skipped for confexts... --- src/sysext/sysext.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index 893d4ce66e4..5099bdcb4ea 100644 --- a/src/sysext/sysext.c +++ b/src/sysext/sysext.c @@ -575,8 +575,7 @@ static const ImagePolicy *pick_image_policy(const Image *img) { } static int merge_subprocess(Hashmap *images, const char *workspace) { - _cleanup_free_ char *host_os_release_id = NULL, *host_os_release_version_id = NULL, *host_os_release_sysext_level = NULL, - *host_os_release_confext_level = NULL, *buf = NULL; + _cleanup_free_ char *host_os_release_id = NULL, *host_os_release_version_id = NULL, *host_os_release_api_level = NULL, *buf = NULL; _cleanup_strv_free_ char **extensions = NULL, **paths = NULL; size_t n_extensions = 0; unsigned n_ignored = 0; @@ -603,13 +602,11 @@ static int merge_subprocess(Hashmap *images, const char *workspace) { return r; /* Acquire host OS release info, so that we can compare it with the extension's data */ - char **host_os_release_level = (arg_image_class == IMAGE_CONFEXT) ? &host_os_release_confext_level : &host_os_release_sysext_level; r = parse_os_release( arg_root, "ID", &host_os_release_id, "VERSION_ID", &host_os_release_version_id, - image_class_info[arg_image_class].level_env, - host_os_release_level); + image_class_info[arg_image_class].level_env, &host_os_release_api_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)) @@ -741,7 +738,7 @@ static int merge_subprocess(Hashmap *images, const char *workspace) { img->name, host_os_release_id, host_os_release_version_id, - host_os_release_sysext_level, + host_os_release_api_level, in_initrd() ? "initrd" : "system", img->extension_release, arg_image_class); -- 2.47.3