This commit is contained in:
Matthias Clasen 2009-07-16 00:12:52 +00:00
parent a49fa03b24
commit 56d7dd67d6
2 changed files with 47 additions and 115 deletions

View File

@ -81,8 +81,7 @@ Desktop file to add GNOME to display manager session menu.
%setup -q %setup -q
%patch0 -p1 -b .polkit1 %patch0 -p1 -b .polkit1
#workaround broken perl-XML-Parser on 64bit arches echo "ACLOCAL_AMFLAGS = -I m4" >> Makefile.am
export PERL5LIB=/usr/lib64/perl5/vendor_perl/5.8.2 perl
autoreconf -i -f autoreconf -i -f
@ -157,11 +156,11 @@ fi
%doc %{_mandir}/man*/* %doc %{_mandir}/man*/*
%{_datadir}/applications/gnome-session-properties.desktop %{_datadir}/applications/gnome-session-properties.desktop
%dir %{_datadir}/gnome-session %dir %{_datadir}/gnome-session
%{_datadir}/gnome-session/session-properties.glade
%{_datadir}/gnome-session/gsm-inhibit-dialog.glade
%{_datadir}/gnome/autostart %{_datadir}/gnome/autostart
%{_bindir}/* %{_bindir}/*
%{_sysconfdir}/gconf/schemas/*.schemas %{_sysconfdir}/gconf/schemas/*.schemas
%{_datadir}/gnome-session/gsm-inhibit-dialog.ui
%{_datadir}/gnome-session/session-properties.ui
%{_datadir}/icons/hicolor/*/apps/session-properties.png %{_datadir}/icons/hicolor/*/apps/session-properties.png
%{_datadir}/icons/hicolor/scalable/apps/session-properties.svg %{_datadir}/icons/hicolor/scalable/apps/session-properties.svg
%dir %{_libdir}/gnome-session %dir %{_libdir}/gnome-session

View File

@ -1,7 +1,7 @@
diff -up gnome-session-2.26.1/configure.in.polkit1 gnome-session-2.26.1/configure.in diff -up gnome-session-2.27.4/configure.in.polkit1 gnome-session-2.27.4/configure.in
--- gnome-session-2.26.1/configure.in.polkit1 2009-04-14 11:31:47.000000000 -0400 --- gnome-session-2.27.4/configure.in.polkit1 2009-07-15 10:53:06.000000000 -0400
+++ gnome-session-2.26.1/configure.in 2009-06-12 19:51:49.223577026 -0400 +++ gnome-session-2.27.4/configure.in 2009-07-15 19:52:55.779086207 -0400
@@ -31,7 +31,7 @@ AC_ARG_WITH(at-spi-registryd-directory, @@ -32,7 +32,7 @@ AC_ARG_WITH(at-spi-registryd-directory,
AT_SPI_REGISTRYD_DIR=$with_at_spi_registryd_directory AT_SPI_REGISTRYD_DIR=$with_at_spi_registryd_directory
AC_SUBST(AT_SPI_REGISTRYD_DIR) AC_SUBST(AT_SPI_REGISTRYD_DIR)
@ -10,15 +10,15 @@ diff -up gnome-session-2.26.1/configure.in.polkit1 gnome-session-2.26.1/configur
AC_ARG_ENABLE(deprecations, AC_ARG_ENABLE(deprecations,
[AC_HELP_STRING([--enable-deprecations], [AC_HELP_STRING([--enable-deprecations],
@@ -48,7 +48,6 @@ LIBGNOMEUI_REQUIRED=2.2.0 @@ -48,7 +48,6 @@ GLIB_REQUIRED=2.16.0
GTK_REQUIRED=2.11.1 LIBGNOMEUI_REQUIRED=2.2.0
GLADE_REQUIRED=2.3.6 GTK_REQUIRED=2.12.0
DBUS_GLIB_REQUIRED=0.76 DBUS_GLIB_REQUIRED=0.76
-POLKIT_GNOME_REQUIRED=0.7 -POLKIT_GNOME_REQUIRED=0.7
dnl ==================================================================== dnl ====================================================================
dnl Dependency Checks dnl Dependency Checks
@@ -88,21 +87,6 @@ PKG_CHECK_MODULES(GCONF, gconf-2.0) @@ -86,21 +85,6 @@ PKG_CHECK_MODULES(GCONF, gconf-2.0)
PKG_CHECK_MODULES(EGG_SMCLIENT, gtk+-2.0) PKG_CHECK_MODULES(EGG_SMCLIENT, gtk+-2.0)
@ -40,9 +40,9 @@ diff -up gnome-session-2.26.1/configure.in.polkit1 gnome-session-2.26.1/configur
dnl ==================================================================== dnl ====================================================================
dnl GConf Checks dnl GConf Checks
diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-session-2.26.1/gnome-session/gsm-consolekit.c diff -up gnome-session-2.27.4/gnome-session/gsm-consolekit.c.polkit1 gnome-session-2.27.4/gnome-session/gsm-consolekit.c
--- gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 2009-04-14 11:31:45.000000000 -0400 --- gnome-session-2.27.4/gnome-session/gsm-consolekit.c.polkit1 2009-07-01 08:45:30.000000000 -0400
+++ gnome-session-2.26.1/gnome-session/gsm-consolekit.c 2009-06-12 19:57:53.643580353 -0400 +++ gnome-session-2.27.4/gnome-session/gsm-consolekit.c 2009-07-15 19:57:50.969319136 -0400
@@ -31,10 +31,6 @@ @@ -31,10 +31,6 @@
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h> #include <dbus/dbus-glib-lowlevel.h>
@ -54,75 +54,7 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
#include "gsm-marshal.h" #include "gsm-marshal.h"
#include "gsm-consolekit.h" #include "gsm-consolekit.h"
@@ -321,64 +317,18 @@ gsm_consolekit_new (void) @@ -413,177 +409,6 @@ emit_stop_complete (GsmConsolekit *manag
return manager;
}
-static gboolean
-try_system_stop (DBusGConnection *connection,
- GError **error)
-{
- DBusGProxy *proxy;
- gboolean res;
-
- proxy = dbus_g_proxy_new_for_name (connection,
- CK_NAME,
- CK_MANAGER_PATH,
- CK_MANAGER_INTERFACE);
-
- res = dbus_g_proxy_call_with_timeout (proxy,
- "Stop",
- INT_MAX,
- error,
- /* parameters: */
- G_TYPE_INVALID,
- /* return values: */
- G_TYPE_INVALID);
- return res;
-}
-
-static gboolean
-try_system_restart (DBusGConnection *connection,
- GError **error)
-{
- DBusGProxy *proxy;
- gboolean res;
-
- proxy = dbus_g_proxy_new_for_name (connection,
- CK_NAME,
- CK_MANAGER_PATH,
- CK_MANAGER_INTERFACE);
-
- res = dbus_g_proxy_call_with_timeout (proxy,
- "Restart",
- INT_MAX,
- error,
- /* parameters: */
- G_TYPE_INVALID,
- /* return values: */
- G_TYPE_INVALID);
- return res;
-}
-
static void
emit_restart_complete (GsmConsolekit *manager,
- const char *error_message)
+ GError *error)
{
GError *call_error;
call_error = NULL;
- if (error_message != NULL) {
+ if (error != NULL) {
call_error = g_error_new_literal (GSM_CONSOLEKIT_ERROR,
GSM_CONSOLEKIT_ERROR_RESTARTING,
- error_message);
+ error->message);
}
g_signal_emit (G_OBJECT (manager),
@@ -413,178 +363,6 @@ emit_stop_complete (GsmConsolekit *manag
} }
} }
@ -138,7 +70,7 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
- -
- if (!gained_privilege) { - if (!gained_privilege) {
- if (error != NULL) { - if (error != NULL) {
- emit_restart_complete (manager, error->message); - emit_restart_complete (manager, error);
- } - }
- -
- return; - return;
@ -150,10 +82,10 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
- -
- if (!res) { - if (!res) {
- g_warning ("Unable to restart system: %s", local_error->message); - g_warning ("Unable to restart system: %s", local_error->message);
- emit_restart_complete (manager, local_error->message); - emit_restart_complete (manager, local_error);
- g_error_free (local_error); - g_error_free (local_error);
- - } else {
- return; - emit_restart_complete (manager, NULL);
- } - }
-} -}
- -
@ -182,8 +114,8 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
- g_warning ("Unable to stop system: %s", local_error->message); - g_warning ("Unable to stop system: %s", local_error->message);
- emit_stop_complete (manager, local_error); - emit_stop_complete (manager, local_error);
- g_error_free (local_error); - g_error_free (local_error);
- - } else {
- return; - emit_stop_complete (manager, NULL);
- } - }
-} -}
- -
@ -224,7 +156,6 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
-#ifdef HAVE_POLKIT_GNOME -#ifdef HAVE_POLKIT_GNOME
- PolKitAction *action; - PolKitAction *action;
- pid_t pid; - pid_t pid;
- char *error_message = NULL;
- gboolean res = FALSE; - gboolean res = FALSE;
- guint xid; - guint xid;
- GError *local_error; - GError *local_error;
@ -244,14 +175,14 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
- -
- polkit_action_unref (action); - polkit_action_unref (action);
- -
- if (local_error != NULL) {
- error_message = g_strdup (local_error->message);
- g_error_free (local_error);
- }
-
- if (!res) { - if (!res) {
- emit_restart_complete (manager, error_message); - if (local_error != NULL) {
- g_free (error_message); - g_warning ("Unable to obtain auth to restart system: %s",
- local_error->message);
-
- emit_restart_complete (manager, local_error);
- g_error_free (local_error);
- }
- } - }
-#else -#else
- g_assert_not_reached (); - g_assert_not_reached ();
@ -301,7 +232,7 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
void void
gsm_consolekit_attempt_restart (GsmConsolekit *manager) gsm_consolekit_attempt_restart (GsmConsolekit *manager)
{ {
@@ -600,15 +378,16 @@ gsm_consolekit_attempt_restart (GsmConso @@ -600,16 +425,16 @@ gsm_consolekit_attempt_restart (GsmConso
return; return;
} }
@ -317,15 +248,16 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
- if (dbus_g_error_has_name (error, "org.freedesktop.ConsoleKit.Manager.NotPrivileged")) { - if (dbus_g_error_has_name (error, "org.freedesktop.ConsoleKit.Manager.NotPrivileged")) {
- request_restart_priv (manager, error); - request_restart_priv (manager, error);
- } else { - } else {
- emit_restart_complete (manager, error->message); - g_warning ("Unable to restart system: %s", error->message);
- emit_restart_complete (manager, error);
- } - }
- -
+ g_warning ("Unable to restart system: %s", error->message); + g_warning ("Unable to restart system: %s", error->message);
+ emit_restart_complete (manager, error); + emit_restart_complete (manager, error);
g_error_free (error); g_error_free (error);
} } else {
} emit_restart_complete (manager, NULL);
@@ -628,16 +407,16 @@ gsm_consolekit_attempt_stop (GsmConsolek @@ -632,16 +457,16 @@ gsm_consolekit_attempt_stop (GsmConsolek
return; return;
} }
@ -338,18 +270,19 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
+ G_TYPE_INVALID); + G_TYPE_INVALID);
if (!res) { if (!res) {
g_warning ("Unable to stop system: %s", error->message);
- if (dbus_g_error_has_name (error, "org.freedesktop.ConsoleKit.Manager.NotPrivileged")) { - if (dbus_g_error_has_name (error, "org.freedesktop.ConsoleKit.Manager.NotPrivileged")) {
- request_stop_priv (manager, error); - request_stop_priv (manager, error);
- } else { - } else {
- g_warning ("Unable to stop system: %s", error->message);
- emit_stop_complete (manager, error); - emit_stop_complete (manager, error);
- } - }
- -
+ g_warning ("Unable to stop system: %s", error->message);
+ emit_stop_complete (manager, error); + emit_stop_complete (manager, error);
g_error_free (error); g_error_free (error);
} } else {
} emit_stop_complete (manager, NULL);
@@ -901,347 +680,78 @@ gsm_consolekit_can_switch_user (GsmConso @@ -907,347 +732,78 @@ gsm_consolekit_can_switch_user (GsmConso
return ret; return ret;
} }
@ -572,10 +505,10 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
- -
- g_ptr_array_foreach (array, (GFunc) g_free, NULL); - g_ptr_array_foreach (array, (GFunc) g_free, NULL);
- g_ptr_array_free (array, TRUE); - g_ptr_array_free (array, TRUE);
-
- return single; - return single;
-} -}
-
-static void -static void
-obtain_privileges_cb (PolKitAction *action, -obtain_privileges_cb (PolKitAction *action,
- gboolean gained_privilege, - gboolean gained_privilege,
@ -740,10 +673,10 @@ diff -up gnome-session-2.26.1/gnome-session/gsm-consolekit.c.polkit1 gnome-sessi
} }
gchar * gchar *
diff -up gnome-session-2.26.1/gnome-session/Makefile.am.polkit1 gnome-session-2.26.1/gnome-session/Makefile.am diff -up gnome-session-2.27.4/gnome-session/Makefile.am.polkit1 gnome-session-2.27.4/gnome-session/Makefile.am
--- gnome-session-2.26.1/gnome-session/Makefile.am.polkit1 2009-04-14 11:31:45.000000000 -0400 --- gnome-session-2.27.4/gnome-session/Makefile.am.polkit1 2009-07-01 08:45:30.000000000 -0400
+++ gnome-session-2.26.1/gnome-session/Makefile.am 2009-06-12 19:51:49.228578549 -0400 +++ gnome-session-2.27.4/gnome-session/Makefile.am 2009-07-15 19:53:08.955071147 -0400
@@ -16,7 +16,6 @@ INCLUDES = \ @@ -17,7 +17,6 @@ INCLUDES = \
$(ICE_CFLAGS) \ $(ICE_CFLAGS) \
$(GNOME_SESSION_CFLAGS) \ $(GNOME_SESSION_CFLAGS) \
$(GCONF_CFLAGS) \ $(GCONF_CFLAGS) \
@ -751,11 +684,11 @@ diff -up gnome-session-2.26.1/gnome-session/Makefile.am.polkit1 gnome-session-2.
-I$(top_srcdir)/egg \ -I$(top_srcdir)/egg \
-DLOCALE_DIR=\""$(datadir)/locale"\" \ -DLOCALE_DIR=\""$(datadir)/locale"\" \
-DDATA_DIR=\""$(datadir)/gnome-session"\" \ -DDATA_DIR=\""$(datadir)/gnome-session"\" \
@@ -49,7 +48,6 @@ gnome_session_LDADD = \ @@ -50,7 +49,6 @@ gnome_session_LDADD = \
$(ICE_LIBS) \ $(ICE_LIBS) \
$(GNOME_SESSION_LIBS) \ $(GNOME_SESSION_LIBS) \
$(GCONF_LIBS) \ $(GCONF_LIBS) \
- $(POLKIT_GNOME_LIBS) \ - $(POLKIT_GNOME_LIBS) \
$(XRENDER_LIBS) \ $(XRENDER_LIBS) \
$(XTEST_LIBS) \ $(XTEST_LIBS) \
$(NULL) $(EXECINFO_LIBS) \