sysupdated: Accept "current+pending" key

Since 594d0345fa the key for
current version might be "current+pending". So in order not to fail
we need to accept it.

Fixes #41409
This commit is contained in:
Valentin David
2026-03-30 10:07:04 +02:00
committed by Daan De Meyer
parent fa6d3bffe3
commit 58dc0abcb1

View File

@@ -1334,7 +1334,9 @@ static int target_method_get_version(sd_bus_message *msg, void *userdata, sd_bus
version_json = sd_json_variant_by_key(v, "current");
if (!version_json)
return log_sysupdate_bad_json(SYNTHETIC_ERRNO(EPROTO), "list", "Missing key 'current'");
version_json = sd_json_variant_by_key(v, "current+pending");
if (!version_json)
return log_sysupdate_bad_json(SYNTHETIC_ERRNO(EPROTO), "list", "Missing key 'current' or 'current+pending'");
if (sd_json_variant_is_null(version_json))
return sd_bus_reply_method_return(msg, "s", "");