packages (DEVEL): gdm/gdm.spec, gdm/gdm-polkit.patch (NEW) - add polkit patch
patrys
patrys at pld-linux.org
Thu Aug 20 12:50:26 CEST 2009
Author: patrys Date: Thu Aug 20 10:50:26 2009 GMT
Module: packages Tag: DEVEL
---- Log message:
- add polkit patch
---- Files affected:
packages/gdm:
gdm.spec (1.229.2.8 -> 1.229.2.9) , gdm-polkit.patch (NONE -> 1.1.2.1) (NEW)
---- Diffs:
================================================================
Index: packages/gdm/gdm.spec
diff -u packages/gdm/gdm.spec:1.229.2.8 packages/gdm/gdm.spec:1.229.2.9
--- packages/gdm/gdm.spec:1.229.2.8 Mon Jul 20 14:58:42 2009
+++ packages/gdm/gdm.spec Thu Aug 20 12:50:20 2009
@@ -34,12 +34,12 @@
Source3: %{name}-pld-logo.png
#Source4: %{name}-autologin.pamd
Patch0: %{name}-xdmcp.patch
+Patch1: %{name}-polkit.patch
Patch2: %{name}-xsession.patch
Patch4: %{name}-defaults.patch
URL: http://www.gnome.org/projects/gdm/
BuildRequires: ConsoleKit-devel
BuildRequires: GConf2-devel >= 2.24.0
-BuildRequires: PolicyKit-gnome-devel >= 0.8
BuildRequires: attr-devel
BuildRequires: audit-libs-devel
BuildRequires: autoconf >= 2.60
@@ -55,10 +55,11 @@
BuildRequires: libglade2-devel >= 1:2.6.2
%{?with_selinux:BuildRequires: libselinux-devel}
BuildRequires: libtool
-BuildRequires: libxklavier-devel >= 4.0
+BuildRequires: libxklavier-devel >= 4.0-2
BuildRequires: pam-devel
BuildRequires: perl-modules
BuildRequires: pkgconfig
+BuildRequires: polkit-gnome-devel >= 0.92
BuildRequires: rpmbuild(find_lang) >= 1.23
BuildRequires: rpmbuild(macros) >= 1.311
BuildRequires: scrollkeeper
@@ -75,11 +76,11 @@
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
Requires: /usr/bin/Xorg
-Requires: PolicyKit-gnome >= 0.8
Requires: gnome-session >= 2.24.0
Requires: gnome-settings-daemon >= 2.24.0
Requires: libgnomeui >= 2.24.0
Requires: pam >= 0.99.7.1
+Requires: polkit-gnome >= 0.92
Requires: which
Requires: xorg-app-sessreg
Requires: xorg-app-xmodmap
@@ -144,6 +145,7 @@
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%patch2 -p1
%patch4 -p1
rm -f data/gdm.schemas.in
@@ -274,8 +276,9 @@
%attr(750,xdm,xdm) /home/services/xdm
%{_pixmapsdir}/*
%{_datadir}/gdm
-%{_iconsdir}/hicolor/*/apps/*.png
%{_datadir}/gnome-2.0/ui/GNOME_FastUserSwitchApplet.xml
+%{_datadir}/polkit-1/actions/gdm.policy
+%{_iconsdir}/hicolor/*/apps/*.png
%{_libdir}/bonobo/servers/*.server
%{_localstatedir}/lib/gdm
@@ -289,6 +292,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.229.2.9 2009/08/20 10:50:20 patrys
+- add polkit patch
+
Revision 1.229.2.8 2009/07/20 12:58:42 patrys
- 2.27.4
================================================================
Index: packages/gdm/gdm-polkit.patch
diff -u /dev/null packages/gdm/gdm-polkit.patch:1.1.2.1
--- /dev/null Thu Aug 20 12:50:26 2009
+++ packages/gdm/gdm-polkit.patch Thu Aug 20 12:50:20 2009
@@ -0,0 +1,318 @@
+From 09153c6825e5b5157fba7600cefabb762d887891 Mon Sep 17 00:00:00 2001
+From: Robert Ancell <robert.ancell at ubuntu.com>
+Date: Thu, 6 Aug 2009 15:57:15 +0100
+Subject: [PATCH 1/2] Add PolicyKit support to GDM settings D-Bus interface
+Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/395299
+Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=587750
+
+diff -Nur -x '*.orig' -x '*~' gdm-2.27.4/common/gdm-settings.c gdm-2.27.4.new/common/gdm-settings.c
+--- gdm-2.27.4/common/gdm-settings.c 2009-05-19 16:18:12.000000000 +0100
++++ gdm-2.27.4.new/common/gdm-settings.c 2009-08-07 09:25:34.000000000 +0100
+@@ -36,6 +36,7 @@
+ #define DBUS_API_SUBJECT_TO_CHANGE
+ #include <dbus/dbus-glib.h>
+ #include <dbus/dbus-glib-lowlevel.h>
++#include <polkit/polkit.h>
+
+ #include "gdm-settings.h"
+ #include "gdm-settings-glue.h"
+@@ -110,6 +111,90 @@
+ return res;
+ }
+
++static void
++unlock_auth_cb (PolkitAuthority *authority,
++ GAsyncResult *result,
++ DBusGMethodInvocation *context)
++{
++ PolkitAuthorizationResult *auth_result;
++ GError *error = NULL;
++
++ auth_result = polkit_authority_check_authorization_finish (authority, result, &error);
++
++ if (!auth_result)
++ dbus_g_method_return_error (context, error);
++ else {
++ dbus_g_method_return (context,
++ polkit_authorization_result_get_is_authorized (auth_result));
++ }
++
++ if (auth_result)
++ g_object_unref (auth_result);
++ if (error)
++ g_error_free (error);
++}
++
++gboolean
++gdm_settings_unlock (GdmSettings *settings,
++ DBusGMethodInvocation *context)
++{
++ polkit_authority_check_authorization (polkit_authority_get (),
++ polkit_system_bus_name_new (dbus_g_method_get_sender (context)),
++ "org.gnome.displaymanager.settings.write",
++ NULL,
++ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
++ NULL,
++ (GAsyncReadyCallback) unlock_auth_cb,
++ context);
++}
++
++typedef struct
++{
++ GdmSettings *settings;
++ DBusGMethodInvocation *context;
++ gchar *key, *value;
++} SetValueData;
++
++static void
++set_value_auth_cb (PolkitAuthority *authority,
++ GAsyncResult *result,
++ SetValueData *data)
++{
++ PolkitAuthorizationResult *auth_result;
++ GError *error = NULL;
++
++ auth_result = polkit_authority_check_authorization_finish (authority, result, &error);
++
++ if (!auth_result)
++ dbus_g_method_return_error (data->context, error);
++ else {
++ if (polkit_authorization_result_get_is_authorized (auth_result)) {
++ gboolean result;
++
++ result = gdm_settings_backend_set_value (data->settings->priv->backend,
++ data->key,
++ data->value,
++ &error);
++ if (result)
++ dbus_g_method_return (data->context);
++ else
++ dbus_g_method_return_error (data->context, error);
++ }
++ else {
++ error = g_error_new (DBUS_GERROR_REMOTE_EXCEPTION, 0, "Not authorized");
++ dbus_g_method_return_error (data->context, error);
++ }
++ }
++
++ if (auth_result)
++ g_object_unref (auth_result);
++ if (error)
++ g_error_free (error);
++ g_free (data->key);
++ g_free (data->value);
++ g_free (data);
++}
++
+ /*
+ dbus-send --system --print-reply --dest=org.gnome.DisplayManager /org/gnome/DisplayManager/Settings org.gnome.DisplayManager.Settings.SetValue string:"xdmcp/Enable" string:"false"
+ */
+@@ -118,26 +203,30 @@
+ gdm_settings_set_value (GdmSettings *settings,
+ const char *key,
+ const char *value,
+- GError **error)
++ DBusGMethodInvocation *context)
+ {
+- GError *local_error;
+- gboolean res;
+-
++ SetValueData *data;
++
+ g_return_val_if_fail (GDM_IS_SETTINGS (settings), FALSE);
+ g_return_val_if_fail (key != NULL, FALSE);
+
+ g_debug ("Setting value %s", key);
+-
+- local_error = NULL;
+- res = gdm_settings_backend_set_value (settings->priv->backend,
+- key,
+- value,
+- &local_error);
+- if (! res) {
+- g_propagate_error (error, local_error);
+- }
+-
+- return res;
++
++ /* Authorize with PolicyKit */
++ data = g_malloc (sizeof(SetValueData));
++ data->settings = settings;
++ data->context = context;
++ data->key = g_strdup(key);
++ data->value = g_strdup(value);
++ polkit_authority_check_authorization (polkit_authority_get (),
++ polkit_system_bus_name_new (dbus_g_method_get_sender (context)),
++ "org.gnome.displaymanager.settings.write",
++ NULL,
++ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
++ NULL,
++ (GAsyncReadyCallback) set_value_auth_cb,
++ data);
++ return TRUE;
+ }
+
+ static gboolean
+diff -Nur -x '*.orig' -x '*~' gdm-2.27.4/common/gdm-settings.h gdm-2.27.4.new/common/gdm-settings.h
+--- gdm-2.27.4/common/gdm-settings.h 2009-05-19 16:18:12.000000000 +0100
++++ gdm-2.27.4.new/common/gdm-settings.h 2009-08-07 09:25:34.000000000 +0100
+@@ -23,6 +23,7 @@
+ #define __GDM_SETTINGS_H
+
+ #include <glib-object.h>
++#include <dbus/dbus-glib.h>
+
+ G_BEGIN_DECLS
+
+@@ -70,10 +71,12 @@
+ const char *key,
+ char **value,
+ GError **error);
++gboolean gdm_settings_unlock (GdmSettings *settings,
++ DBusGMethodInvocation *context);
+ gboolean gdm_settings_set_value (GdmSettings *settings,
+ const char *key,
+ const char *value,
+- GError **error);
++ DBusGMethodInvocation *context);
+
+ G_END_DECLS
+
+diff -Nur -x '*.orig' -x '*~' gdm-2.27.4/common/gdm-settings.xml gdm-2.27.4.new/common/gdm-settings.xml
+--- gdm-2.27.4/common/gdm-settings.xml 2009-05-19 16:18:12.000000000 +0100
++++ gdm-2.27.4.new/common/gdm-settings.xml 2009-08-07 09:25:34.000000000 +0100
+@@ -5,7 +5,12 @@
+ <arg name="key" direction="in" type="s"/>
+ <arg name="value" direction="out" type="s"/>
+ </method>
++ <method name="Unlock">
++ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
++ <arg name="is_unlocked" direction="out" type="b"/>
++ </method>
+ <method name="SetValue">
++ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="key" direction="in" type="s"/>
+ <arg name="value" direction="in" type="s"/>
+ </method>
+diff -Nur -x '*.orig' -x '*~' gdm-2.27.4/configure.ac gdm-2.27.4.new/configure.ac
+--- gdm-2.27.4/configure.ac 2009-08-07 09:25:33.000000000 +0100
++++ gdm-2.27.4.new/configure.ac 2009-08-07 09:25:34.000000000 +0100
+@@ -40,6 +40,7 @@
+ dnl ---------------------------------------------------------------------------
+
+ DBUS_GLIB_REQUIRED_VERSION=0.74
++POLKIT_GOBJECT_REQUIRED_VERSION=0.92
+ GLIB_REQUIRED_VERSION=2.15.4
+ GTK_REQUIRED_VERSION=2.10.0
+ PANGO_REQUIRED_VERSION=1.3.0
+@@ -59,6 +60,7 @@
+
+ PKG_CHECK_MODULES(COMMON,
+ dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
++ polkit-gobject-1 >= $POLKIT_GOBJECT_REQUIRED_VERSION
+ gobject-2.0 >= $GLIB_REQUIRED_VERSION
+ gio-2.0 >= $GLIB_REQUIRED_VERSION
+ )
+@@ -67,6 +69,7 @@
+
+ PKG_CHECK_MODULES(DAEMON,
+ dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
++ polkit-gobject-1 >= $POLKIT_GOBJECT_REQUIRED_VERSION
+ gobject-2.0 >= $GLIB_REQUIRED_VERSION
+ hal
+ )
+diff -Nur -x '*.orig' -x '*~' gdm-2.27.4/data/gdm.conf.in gdm-2.27.4.new/data/gdm.conf.in
+--- gdm-2.27.4/data/gdm.conf.in 2009-07-17 20:38:19.000000000 +0100
++++ gdm-2.27.4.new/data/gdm.conf.in 2009-08-07 09:25:34.000000000 +0100
+@@ -34,8 +34,6 @@
+ <deny send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.LocalDisplayFactory"/>
+ <deny send_destination="org.gnome.DisplayManager"
+- send_interface="org.gnome.DisplayManager.Settings"/>
+- <deny send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.Slave"/>
+ <deny send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.Session"/>
+@@ -44,6 +42,10 @@
+ <allow send_destination="org.gnome.DisplayManager"
+ send_interface="org.freedesktop.DBus.Introspectable"/>
+
++ <!-- Controlled by PolicyKit -->
++ <allow send_destination="org.gnome.DisplayManager"
++ send_interface="org.gnome.DisplayManager.Settings"/>
++
+ <allow send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.Display"
+ send_member="GetId"/>
+diff -Nur -x '*.orig' -x '*~' gdm-2.27.4/data/gdm.policy.in gdm-2.27.4.new/data/gdm.policy.in
+--- gdm-2.27.4/data/gdm.policy.in 1970-01-01 01:00:00.000000000 +0100
++++ gdm-2.27.4.new/data/gdm.policy.in 2009-08-07 09:25:34.000000000 +0100
+@@ -0,0 +1,18 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE policyconfig PUBLIC
++ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
++ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
++<policyconfig>
++ <vendor>The GNOME Project</vendor>
++ <vendor_url>http://www.gnome.org/</vendor_url>
++ <icon_name>gdm</icon_name>
++
++ <action id="org.gnome.displaymanager.settings.write">
++ <description>Change login screen configuration</description>
++ <message>Privileges are required to change the login screen configuration.</message>
++ <defaults>
++ <allow_inactive>no</allow_inactive>
++ <allow_active>auth_admin_keep</allow_active>
++ </defaults>
++ </action>
++</policyconfig>
+diff -Nur -x '*.orig' -x '*~' gdm-2.27.4/data/Makefile.am gdm-2.27.4.new/data/Makefile.am
+--- gdm-2.27.4/data/Makefile.am 2009-05-19 16:18:12.000000000 +0100
++++ gdm-2.27.4.new/data/Makefile.am 2009-08-07 09:25:34.000000000 +0100
+@@ -44,6 +44,8 @@
+ schemas_in_files = gdm.schemas.in
+ schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
+
++ at INTLTOOL_POLICY_RULE@
++
+ gdm.schemas.in: $(srcdir)/gdm.schemas.in.in
+ sed -e 's,[@]GDMPREFETCHCMD[@],$(GDMPREFETCHCMD),g' \
+ -e 's,[@]GDM_CUSTOM_CONF[@],$(GDM_CUSTOM_CONF),g' \
+@@ -73,10 +75,17 @@
+ -e 's,[@]sbindir[@],$(sbindir),g' \
+ <$(srcdir)/gdm.schemas.in.in >gdm.schemas.in
+
++polkitdir = $(datadir)/polkit-1/actions
++polkit_in_files = gdm.policy.in
++polkit_DATA = $(polkit_in_files:.policy.in=.policy)
++check:
++ $(POLKIT_POLICY_FILE_VALIDATE) $(polkit_DATA)
++
+ EXTRA_DIST = \
+ $(schemas_in_files) \
+ $(schemas_DATA) \
+ $(dbusconf_in_files) \
++ $(polkit_in_files) \
+ gdm.schemas.in.in \
+ gdm.conf-custom.in \
+ Xsession.in \
+@@ -99,7 +108,8 @@
+ $(NULL)
+
+ DISTCLEANFILES = \
+- $(dbusconf_DATA) \
++ $(dbusconf_DATA) \
++ $(polkit_DATA) \
+ gdm.schemas \
+ $(NULL)
+
+--- gdm-2.27.4/common/Makefile.am~ 2009-05-19 17:18:12.000000000 +0200
++++ gdm-2.27.4/common/Makefile.am 2009-08-20 12:17:16.150977333 +0200
+@@ -110,6 +110,7 @@
+ $(NULL)
+
+ libgdmcommon_la_LIBADD = \
++ $(COMMON_LIBS) \
+ $(NULL)
+
+ libgdmcommon_la_LDFLAGS = \
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/gdm/gdm.spec?r1=1.229.2.8&r2=1.229.2.9&f=u
More information about the pld-cvs-commit
mailing list