From: noxiouz Date: Mon, 2 Mar 2026 10:04:37 +0000 (+0000) Subject: login: fix ReleaseSession.Id dispatch flag in io.systemd.Login Varlink handler X-Git-Tag: v260-rc2~40^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eacf0d321067ba2b2d25d463e4bf2366b68a90c;p=thirdparty%2Fsystemd.git login: fix ReleaseSession.Id dispatch flag in io.systemd.Login Varlink handler The ReleaseSession method's Id field is declared as nullable (?string) in the IDL, allowing callers to omit it so that the method releases the caller's own session via session_is_self(NULL). The SD_JSON_MANDATORY flag in the dispatch table contradicts this and makes omitting Id return -EINVAL ("Invalid argument", parameter "Id") instead. Drop the flag so omitting Id is treated as passing NULL. Fixes: 2baca6c22b2d75b8ba2d0bd8a9e7f4a8579752ed --- diff --git a/src/login/logind-varlink.c b/src/login/logind-varlink.c index a1fdac01c90..ae2e32d3faf 100644 --- a/src/login/logind-varlink.c +++ b/src/login/logind-varlink.c @@ -308,7 +308,7 @@ static int vl_method_release_session(sd_varlink *link, sd_json_variant *paramete } p; static const sd_json_dispatch_field dispatch_table[] = { - { "Id", SD_JSON_VARIANT_STRING, sd_json_dispatch_const_string, voffsetof(p, id), SD_JSON_MANDATORY }, + { "Id", SD_JSON_VARIANT_STRING, sd_json_dispatch_const_string, voffsetof(p, id), 0 }, {} };