From 3eacf0d321067ba2b2d25d463e4bf2366b68a90c Mon Sep 17 00:00:00 2001 From: noxiouz Date: Mon, 2 Mar 2026 10:04:37 +0000 Subject: [PATCH] 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 --- src/login/logind-varlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/login/logind-varlink.c b/src/login/logind-varlink.c index a1fdac01c9..ae2e32d3fa 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 }, {} };