login: fix session_kill(..., KILL_LEADER,...) (#35105)
author12paper <104864644+12paper@users.noreply.github.com>
Sun, 10 Nov 2024 02:13:39 +0000 (03:13 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 13 Nov 2024 19:48:10 +0000 (19:48 +0000)
commitc89c5d04f33dbc5c6dfb67b8bc58cbd3d924b434
tree9238c8d60d8fa3f7ea05852d7a03e39d8546d716
parent688eb20fdb9c4bcc6d205323f9cec119d6273169
login: fix session_kill(..., KILL_LEADER,...) (#35105)

`loginctl kill-session --kill-whom=leader <N>` (or the D-Bus equivalent)
doesn't work because logind ends up calling `KillUnit(..., "main", ...)`
on a scope unit and these don't have a `MainPID` property. Here, I just
make it send a signal to the `Leader` directly.

(cherry picked from commit 8254755091847105c33e473c62cdc7621ed275bc)
src/login/logind-session.c