From: Lennart Poettering Date: Wed, 16 Feb 2022 21:58:19 +0000 (+0100) Subject: logind: fix bool/int confusion for KillUserProcesses bus property X-Git-Tag: v251-rc1~273^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F22543%2Fhead;p=thirdparty%2Fsystemd.git logind: fix bool/int confusion for KillUserProcesses bus property sd-bus for compat with old C expects "int" for booleans. Internally we prefer to use C99 "bool" however. When pointing a pointer to it, we need to handle the fact that they are typically differently sized, hence use te right accessors for it. --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 30bddb5402d..cd0dcea0e50 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -3283,7 +3283,7 @@ static const sd_bus_vtable manager_vtable[] = { SD_BUS_PROPERTY("NAutoVTs", "u", NULL, offsetof(Manager, n_autovts), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("KillOnlyUsers", "as", NULL, offsetof(Manager, kill_only_users), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("KillExcludeUsers", "as", NULL, offsetof(Manager, kill_exclude_users), SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("KillUserProcesses", "b", NULL, offsetof(Manager, kill_user_processes), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("KillUserProcesses", "b", bus_property_get_bool, offsetof(Manager, kill_user_processes), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("RebootParameter", "s", property_get_reboot_parameter, 0, 0), SD_BUS_PROPERTY("RebootToFirmwareSetup", "b", property_get_reboot_to_firmware_setup, 0, 0), SD_BUS_PROPERTY("RebootToBootLoaderMenu", "t", property_get_reboot_to_boot_loader_menu, 0, 0),