consolekit: apply two upstream patches

svn path=/nixpkgs/trunk/; revision=21960
This commit is contained in:
Yury G. Kudryashov 2010-05-25 06:43:34 +00:00
parent e436eb4915
commit 2f1b9ce8f9
3 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,28 @@
Upstream patch
From fc2870a65f6b3ed3b71bcac69c5faf3a9c759c64 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Mon, 21 Dec 2009 11:13:23 -0500
Subject: [PATCH 1/2] Don't daemonize when activated
It confuses some versions of D-Bus and isn't needed
(or wanted it).
http://bugs.freedesktop.org/show_bug.cgi?id=25642
---
data/org.freedesktop.ConsoleKit.service.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/data/org.freedesktop.ConsoleKit.service.in b/data/org.freedesktop.ConsoleKit.service.in
index ec2128c..d716a36 100644
--- a/data/org.freedesktop.ConsoleKit.service.in
+++ b/data/org.freedesktop.ConsoleKit.service.in
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.ConsoleKit
-Exec=@sbindir@/console-kit-daemon
+Exec=@sbindir@/console-kit-daemon --no-daemon
User=root
--
1.7.1

View File

@ -0,0 +1,62 @@
Upstream patch
From 2418840248f07025ad0edc96ed17e03ce5e47f3e Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 21 Dec 2009 11:14:54 -0500
Subject: [PATCH 2/2] Don't take bus name until ready
Previously, we would take a bus name right away, but
not register the manager object until later. This
causes a race when being activated by a method call
on the manager object, where ConsoleKit gets started
but the method call fails.
https://bugs.freedesktop.org/show_bug.cgi?id=25744
---
src/main.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main.c b/src/main.c
index 809c6d6..b8f698f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -294,11 +294,19 @@ main (int argc,
setup_debug_log (debug);
+ g_debug ("initializing console-kit-daemon %s", VERSION);
+
connection = get_system_bus ();
if (connection == NULL) {
goto out;
}
+ manager = ck_manager_new ();
+
+ if (manager == NULL) {
+ goto out;
+ }
+
bus_proxy = get_bus_proxy (connection);
if (bus_proxy == NULL) {
g_warning ("Could not construct bus_proxy object; bailing out");
@@ -310,16 +318,8 @@ main (int argc,
goto out;
}
- g_debug ("initializing console-kit-daemon %s", VERSION);
-
create_pid_file ();
- manager = ck_manager_new ();
-
- if (manager == NULL) {
- goto out;
- }
-
loop = g_main_loop_new (NULL, FALSE);
g_signal_connect (bus_proxy,
--
1.7.1

View File

@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
};
buildInputs = [ pkgconfig dbus_glib zlib pam glib libX11 polkit expat ];
patches = [ ./0001-Don-t-daemonize-when-activated.patch
./0002-Don-t-take-bus-name-until-ready.patch ];
# For console-kit to get the rpath to libgcc_s, needed for pthread_cancel to work
NIX_LDFLAGS = "-lgcc_s";