]> git.ipfire.org Git - thirdparty/systemd.git/commit
portable: fix marker_matches_images() and propagate errors correctly 42915/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Tue, 7 Jul 2026 10:16:42 +0000 (11:16 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 7 Jul 2026 17:03:00 +0000 (18:03 +0100)
commitc70f09853e14de81f3d06992532c7c66828d55a8
tree9ceed1fe8224dd01ff906582cc278c7e8b7e887b
parenta77bd724d3f02fa261cf7d13434550a8c90479e8
portable: fix marker_matches_images() and propagate errors correctly

marker_matches_images() was declared to return bool, but several of its
paths return a negative errno (OOM, parse errors, etc.). A negative int
coerces to true, so every such failure was reported as a "match".

Return int with the tristate semantics the callers already expect.

When detaching by image name instead of the original path, path_pick() may
not resolve a concrete path (e.g. a runtime overlay). Keep comparing the
caller-provided image name, and use the picked path only as an additional
canonical match when it exists.

Follow-up for 907952bbc92dd6656807d9b2eb0d0c94a4c9e865
src/portable/portable.c