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
@@ -2065,6 +2065,7 @@ int setup_namespace(
r = dissect_loop_device(
loop_device,
root_image,
&verity,
root_image_options,
dissect_image_flags,