wmshutdown: Remove support for deprecated Consolekit.

This commit is contained in:
Torrance, Douglas 2018-09-23 02:10:55 +00:00 committed by Carlos R. Mafra
parent ef490d0670
commit eaa934f12a
3 changed files with 2 additions and 21 deletions

View file

@ -20,11 +20,11 @@
Prior to version 1.1, wmshutdown used a setuid program (Shutdown or
wmshutdown-run) to actually shut down the computer, introducing
potential security risks. Beginning in version 1.1, wmshutdown uses
logind instead. In version 1.2, ConsoleKit support was added.
logind instead.
3. Install/Uninstall
./configure (or ./configure --with-consolekit to use ConsoleKit)
./configure
make
make install [as root]

View file

@ -3,15 +3,6 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADER([config.h])
AC_ARG_WITH([consolekit],
[AS_HELP_STRING([--with-consolekit],
[use ConsoleKit instead of logind])],
[AC_DEFINE([CONSOLEKIT], 1,
[Define to 1 if ConsoleKit is used instead of logind.])
AC_MSG_NOTICE([use ConsoleKit])
],
[AC_MSG_NOTICE([use logind])])
AC_PROG_CC
PKG_CHECK_MODULES([gtk],[gtk+-3.0])
PKG_CHECK_MODULES([x11],[x11])

View file

@ -27,19 +27,11 @@
#define GTK_RESPONSE_HALT 1
#define GTK_RESPONSE_REBOOT 2
#ifdef CONSOLEKIT
#define HALT_METHOD "Stop"
#define REBOOT_METHOD "Restart"
#define DBUS_PATH "/org/freedesktop/ConsoleKit/Manager"
#define DBUS_INTERFACE "org.freedesktop.ConsoleKit.Manager"
#define DBUS_DESTINATION "org.freedesktop.ConsoleKit"
#else
#define HALT_METHOD "PowerOff"
#define REBOOT_METHOD "Reboot"
#define DBUS_PATH "/org/freedesktop/login1"
#define DBUS_INTERFACE "org.freedesktop.login1.Manager"
#define DBUS_DESTINATION "org.freedesktop.login1"
#endif
static int showVersion;
GtkWidget *dialog = NULL;
@ -116,9 +108,7 @@ void handle_click(GtkWidget *widget, gpointer data)
DBUS_PATH,
DBUS_INTERFACE,
method);
#ifndef CONSOLEKIT
g_dbus_message_set_body(message, g_variant_new("(b)", TRUE));
#endif
g_dbus_message_set_destination(message, DBUS_DESTINATION);
reply = g_dbus_connection_send_message_with_reply_sync(
connection, message, 0, -1, NULL, NULL, &error);