diff options
author | Luca Boccassi <bluca@debian.org> | 2024-07-03 22:27:28 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-07-04 12:49:28 +0200 |
commit | 92d1fe3efac7b3a700317ec71b64cab5ebc17b42 (patch) | |
tree | 7b5edab4eab3d9fd47c583f7509ce7861a3c09f2 /src/basic/os-util.c | |
parent | mkosi: Build a disk image by default again (diff) | |
download | systemd-92d1fe3efac7b3a700317ec71b64cab5ebc17b42.tar.xz systemd-92d1fe3efac7b3a700317ec71b64cab5ebc17b42.zip |
os-util: avoid matching on the wrong extension-release file
The previous commit tries to extract a substring from the
extension-release suffix, but that is not right, it's only the
images that need to be versioned and extracted, use the extension-release
suffix as-is. Otherwise if it happens to contain a prefix that
matches the wrong image, it will be taken into account.
Follow-up for 37543971aff79f3a37646ffc2bb5845c9394797b
Diffstat (limited to 'src/basic/os-util.c')
-rw-r--r-- | src/basic/os-util.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/basic/os-util.c b/src/basic/os-util.c index 0da4e9d079..9b31a0d325 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -259,13 +259,7 @@ int open_extension_release_at( } if (!relax_extension_release_check) { - _cleanup_free_ char *base_image_name = NULL, *base_extension = NULL; - - r = path_extract_image_name(image_name, &base_image_name); - if (r < 0) { - log_debug_errno(r, "Failed to extract image name from %s/%s, ignoring: %m", dir_path, de->d_name); - continue; - } + _cleanup_free_ char *base_extension = NULL; r = path_extract_image_name(extension, &base_extension); if (r < 0) { @@ -273,7 +267,7 @@ int open_extension_release_at( continue; } - if (!streq(base_image_name, base_extension) && + if (!streq(image_name, base_extension) && extension_release_strict_xattr_value(fd, dir_path, image_name) != 0) continue; } |