Use original filename for extension name check

The loading of an extension image from a symlink "NAME.raw" to
"NAME-VERSION.raw" failed because the release file name check worked
with the backing file of the loop device which already resolves the
symlink and thus the found name "NAME-VERSION" mismatched "NAME".
Pass the original filename and use it instead of the backing file
when available. This fixes the loading of "NAME.raw" extensions which
are a symlink to "NAME-VERSION.raw" as, e.g., may be the case when
systemd-sysupdate manages multiple versions.

Fixes https://github.com/systemd/systemd/issues/24293
This commit is contained in:
Kai Lueke
2022-09-06 03:53:03 +09:00
committed by Yu Watanabe
parent 6f2cea06bf
commit e374439f4b
8 changed files with 42 additions and 10 deletions
+1
View File
@@ -367,6 +367,7 @@ static int portable_extract_by_path(
r = dissect_loop_device(
d,
path,
NULL, NULL,
DISSECT_IMAGE_READ_ONLY |
DISSECT_IMAGE_GENERIC_ROOT |