Your message dated Fri, 25 Jul 2008 22:47:04 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#452627: fixed in consolekit 0.2.10-1
has caused the Debian Bug report #452627,
regarding xinit: Please add ConsoleKit support
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)
--
452627: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452627
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: xinit
Version: 1.0.7-1
Severity: wishlist
Tags: patch
Hi,
the attached patch adds support for ConsoleKit.
It's taken from upstream BTS:
https://bugs.freedesktop.org/show_bug.cgi?id=12378
It can be enabled with the --with-consolekit configure switch (a
autoreconf run is required).
You can find more info about what CK is at
http://www.freedesktop.org/wiki/Software/ConsoleKit
The pkg-utopia group plans to upload a CK enabled hal to unstable in the
near future. This requires that login managers or xinit correctly
registers new sessions within CK. gdm and kdm already have support for
CK.
Cheers,
Michael
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (300, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.23.8
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages xinit depends on:
ii cpp 4:4.2.1-6 The GNU C preprocessor (cpp)
ii libc6 2.6.1-6 GNU C Library: Shared libraries
ii libx11-6 2:1.0.3-7 X11 client-side library
ii x11-common 1:7.3+6 X Window System (X.Org) infrastruc
xinit recommends no packages.
-- no debconf information
diff --git a/Makefile.am b/Makefile.am
index babc2f3..9b912a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,8 +24,8 @@ XINITDIR = $(libdir)/X11/xinit
bin_PROGRAMS = xinit
bin_SCRIPTS = startx
-xinit_CFLAGS = $(XINIT_CFLAGS) -DXINITDIR=\"$(XINITDIR)\"
-DBINDIR=\"$(bindir)\"
-xinit_LDADD = $(XINIT_LIBS)
+xinit_CFLAGS = $(XINIT_CFLAGS) $(CK_CFLAGS) -DXINITDIR=\"$(XINITDIR)\"
-DBINDIR=\"$(bindir)\"
+xinit_LDADD = $(XINIT_LIBS) $(CK_LIBS)
xinit_SOURCES = \
xinit.c
diff --git a/configure.ac b/configure.ac
index 1aee1d2..5775db3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,7 @@ DEFAULT_XMODMAP=xmodmap
DEFAULT_TWM=twm
DEFAULT_XCLOCK=xclock
DEFAULT_XTERM=xterm
+DEFAULT_CK=yes
# You always want to specify the full path to the X server
DEFAULT_XSERVER=${bindir}/X
DEFAULT_XAUTH=xauth
@@ -104,6 +105,20 @@ esac
AC_SUBST(XINIT_CFLAGS)
AC_SUBST(XINIT_LIBS)
+# Check for ConsoleKit
+AC_ARG_WITH(consolekit,
+ AS_HELP_STRING([--with-consolekit], [Use ConsoleKit in xinit]),
+ [CK="$withval"],
+ [CK="$DEFAULT_CK"])
+if test "x$CK" != xno ; then
+ PKG_CHECK_MODULES(CK, ck-connector,
+ have_conkit=yes,
+ [have_conkit=no; echo no])
+ if test "x$have_conkit" = xyes ; then
+ AC_DEFINE(USE_CONKIT, 1, [Define if you have ConsoleKit])
+ fi
+fi
+
AC_PATH_PROGS(MCOOKIE, [mcookie], [$MCOOKIE],
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/local/bin])
if test "x$MCOOKIE" != x ; then
diff --git a/startx.cpp b/startx.cpp
index 42421ef..998c7f8 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -222,6 +222,12 @@ EOF
fi
done
+if [ x"$display" != x ]; then
+ export DISPLAY=$display
+else
+ export DISPLAY=:0
+fi
+
#if defined(__SCO__) || defined(__UNIXWARE__)
if [ "$REMOTE_SERVER" = "TRUE" ]; then
exec SHELL_CMD ${client}
diff --git a/xinit.c b/xinit.c
index 46dee54..c2c4527 100644
--- a/xinit.c
+++ b/xinit.c
@@ -39,6 +39,12 @@ in this Software without prior written authorization from
The Open Group.
#include <ctype.h>
#include <stdint.h>
+#ifdef USE_CONKIT
+#include <ck-connector.h>
+#include <X11/Xatom.h>
+static CkConnector *ckc = NULL;
+#endif /* USE_CONKIT */
+
#ifdef X_POSIX_C_SOURCE
#define _POSIX_C_SOURCE X_POSIX_C_SOURCE
#include <signal.h>
@@ -521,6 +527,39 @@ processTimeout(int timeout, char *string)
return( serverpid != pidfound );
}
+
+#ifdef USE_CONKIT
+static void
+register_new_session_with_console_kit (void)
+{
+ static char conkitbuf[256];
+ DBusError error;
+
+ ckc = ck_connector_new ();
+ if (ckc == NULL) {
+ Error ("Cannot register with ConsoleKit: OOM creating
CkConnector\n");
+ goto out;
+ }
+
+ dbus_error_init (&error);
+ if (!ck_connector_open_session (ckc, &error)) {
+ Error ("Cannot register with ConsoleKit: %s: %s\n", error.name,
error.message);
+ goto out;
+ }
+
+ /* If we managed to register with ConsoleKit, put the
+ * environment variable XDG_SESSION_COOKIE=cookie as second
+ * element in newenviron. See set_environment() where we
+ * earlier have made sure there is room...
+ */
+ conkitbuf[sizeof (conkitbuf) - 1] = '\0';
+ snprintf (conkitbuf, sizeof (conkitbuf) - 1, "XDG_SESSION_COOKIE=%s",
ck_connector_get_cookie (ckc));
+ newenviron[1] = conkitbuf;
+out:
+ ;
+}
+#endif /* USE_CONKIT */
+
static int
startServer(char *server[])
{
@@ -631,6 +670,12 @@ startServer(char *server[])
break;
}
+#ifdef USE_CONKIT
+ if (serverpid != -1 ) {
+ register_new_session_with_console_kit ();
+ }
+#endif /* USE_CONKIT */
+
return(serverpid);
}
@@ -775,6 +820,13 @@ shutdown(void)
clientpid);
}
+#ifdef USE_CONKIT
+ if (ckc != NULL) {
+ ck_connector_unref (ckc);
+ ckc = NULL;
+ }
+#endif
+
if (serverpid < 0)
return;
errno = 0;
@@ -811,6 +863,13 @@ shutdown(void)
* make a new copy of environment that has room for DISPLAY
*/
+
+#ifdef USE_CONKIT
+#define NUM_EXTRA_ENV_VARS 4
+#else
+#define NUM_EXTRA_ENV_VARS 3
+#endif
+
static void
set_environment(void)
{
@@ -822,11 +881,11 @@ set_environment(void)
for (oldPtr = environ; *oldPtr; oldPtr++) ;
nenvvars = (oldPtr - environ);
- newenviron = (char **) malloc ((nenvvars + 3) * sizeof(char **));
+ newenviron = (char **) malloc ((nenvvars + NUM_EXTRA_ENV_VARS) *
sizeof(char **));
if (!newenviron) {
fprintf (stderr,
"%s: unable to allocate %d pointers for environment\n",
- program, nenvvars + 3);
+ program, nenvvars + NUM_EXTRA_ENV_VARS);
exit (1);
}
@@ -836,10 +895,18 @@ set_environment(void)
newPtr = newenviron;
*newPtr++ = displaybuf;
+#ifdef USE_CONKIT
+ *newPtr++ = "XDG_SESSION_COOKIE=";
+#endif
+
/* copy pointers to other variables */
for (oldPtr = environ; *oldPtr; oldPtr++) {
if (strncmp (*oldPtr, "DISPLAY=", 8) != 0
- && strncmp (*oldPtr, "WINDOWPATH=", 11) != 0) {
+ && strncmp (*oldPtr, "WINDOWPATH=", 11) != 0
+#ifdef USE_CONKIT
+ && strncmp (*oldPtr, "XDG_SESSION_COOKIE=", 19) != 0
+#endif
+ ) {
*newPtr++ = *oldPtr;
}
}
--- End Message ---
--- Begin Message ---
Source: consolekit
Source-Version: 0.2.10-1
We believe that the bug you reported is fixed in the latest version of
consolekit, which is due to be installed in the Debian FTP archive:
consolekit_0.2.10-1.diff.gz
to pool/main/c/consolekit/consolekit_0.2.10-1.diff.gz
consolekit_0.2.10-1.dsc
to pool/main/c/consolekit/consolekit_0.2.10-1.dsc
consolekit_0.2.10-1_i386.deb
to pool/main/c/consolekit/consolekit_0.2.10-1_i386.deb
consolekit_0.2.10.orig.tar.gz
to pool/main/c/consolekit/consolekit_0.2.10.orig.tar.gz
libck-connector-dev_0.2.10-1_i386.deb
to pool/main/c/consolekit/libck-connector-dev_0.2.10-1_i386.deb
libck-connector0_0.2.10-1_i386.deb
to pool/main/c/consolekit/libck-connector0_0.2.10-1_i386.deb
libpam-ck-connector_0.2.10-1_i386.deb
to pool/main/c/consolekit/libpam-ck-connector_0.2.10-1_i386.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Michael Biebl <[EMAIL PROTECTED]> (supplier of updated consolekit package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sat, 26 Jul 2008 00:29:46 +0200
Source: consolekit
Binary: consolekit libck-connector0 libck-connector-dev libpam-ck-connector
Architecture: source i386
Version: 0.2.10-1
Distribution: unstable
Urgency: low
Maintainer: Utopia Maintenance Team <[EMAIL PROTECTED]>
Changed-By: Michael Biebl <[EMAIL PROTECTED]>
Description:
consolekit - framework for defining and tracking users, sessions and seats
libck-connector-dev - ConsoleKit development files
libck-connector0 - ConsoleKit libraries
libpam-ck-connector - ConsoleKit PAM module
Closes: 422349 452627 464005 489030
Changes:
consolekit (0.2.10-1) unstable; urgency=low
.
* New upstream release. (Closes: #464005, #489030)
* debian/control
- Add Build-Depends on pkg-config.
- Add Build-Depends on zlib1g-dev.
- Add Build-Depends on quilt.
- Bump Standards-Version to 3.8.0. No further changes.
* debian/org.freedesktop.ConsoleKit.service
- Removed, merged upstream.
* debian/libck-connector0.symbols
- Add symbols file for libck-connector library.
* consolekit.install
- Install all binaries in /usr/bin and /usr/sbin instead of listing them
individually.
- Update the list of installed directories.
- Install 90consolekit into /etc/X11/Xsession.d.
* debian/pam-foreground-compat.ck
- Add run-session.d script which creates pam_console compatible tag files.
Script shamelessly taken from Ubuntu. (Closes: #422349)
* debian/rules
- Install pam-foreground-compat.ck into /usr/lib/ConsoleKit/run-session.d.
- Include patchsys-quilt.mk for patch management.
* debian/90consolekit
- Xsession ConsoleKit integration. Script is taken from Ubuntu but renamed
to better fit with the existing naming conventions for Xsession scripts.
(Closes: #452627)
* debian/patches/01-dbus_policy.patch
- Allow only root to call the Restart and Stop D-Bus methods since we are
not using PolicyKit to restrict the access to those methods.
* debian/patches/02-exit_with_dbus.patch
- Pulled from upstream git. Exit when D-Bus system bus is stopped.
* debian/patches/03-cleanup_console_tags.patch
- Cleanup console tag files on application startup and shutdown.
Checksums-Sha1:
03f2c9fdb01cf138ee718824800b38616bfb63f6 1484 consolekit_0.2.10-1.dsc
ac4107f2239b072156f4a815609ea1c6fbb5f6cf 521473 consolekit_0.2.10.orig.tar.gz
46a21720ee45f5b12b54c84951795ffc0c447c04 6806 consolekit_0.2.10-1.diff.gz
26ca550de1e797ebb0d550b124bcb6456459f7ce 125394 consolekit_0.2.10-1_i386.deb
13e9bd675e38ddd8865b5dbc406183401bb5f09b 40736
libck-connector0_0.2.10-1_i386.deb
0f8e0245ed06925031f4bdc61680a60a653eb0d3 48102
libck-connector-dev_0.2.10-1_i386.deb
38cdd452289be5dea0ecbe0cea2fa4555a04fc01 40990
libpam-ck-connector_0.2.10-1_i386.deb
Checksums-Sha256:
e51b941750bede6f9f3de46b017d1f1c0db5bf2aba812288d36536277818c4a4 1484
consolekit_0.2.10-1.dsc
02b9510f65256db33a5e079736bb7234cd5599bf02dc77399d81d50cf5183bcb 521473
consolekit_0.2.10.orig.tar.gz
ae975d3b9c109a8d7964868fe716651daf7aec6c9ed7630255282adab9e81586 6806
consolekit_0.2.10-1.diff.gz
6e4dc374fe19a77c821a756814b7b03500c8eaa6ef243e9dd8e00ac07354115b 125394
consolekit_0.2.10-1_i386.deb
c1e8fb2d1e3d213972bd0b10a3faf948ec427236b77929efe40f642e0c498939 40736
libck-connector0_0.2.10-1_i386.deb
a5705a70c56c270b67c01441f80e2631bbdc259ae48a8b65347725f26e44f210 48102
libck-connector-dev_0.2.10-1_i386.deb
eda7132e5434b7ea9dbb9e3c46510e504f9735b3c39303602a5bc817c2ea1050 40990
libpam-ck-connector_0.2.10-1_i386.deb
Files:
4683cedd9430aef9896338956fb36c78 1484 admin optional consolekit_0.2.10-1.dsc
b85c2333a8fe31c0d3f29caa14716634 521473 admin optional
consolekit_0.2.10.orig.tar.gz
5189969d8f7d2a2f0e8bcbaace98947d 6806 admin optional
consolekit_0.2.10-1.diff.gz
69a639f4e118385225ce207b0814f149 125394 admin optional
consolekit_0.2.10-1_i386.deb
c9dc89b6e818a6d4fcf3a5f066b5dedf 40736 libs optional
libck-connector0_0.2.10-1_i386.deb
0a15de4d792c7ef8716ef6796ed8ee17 48102 libdevel optional
libck-connector-dev_0.2.10-1_i386.deb
406272e6dbdf08029f976bc92af17569 40990 admin optional
libpam-ck-connector_0.2.10-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkiKVpsACgkQh7PER70FhVTvDwCgyqm2yqG7hvJWvgB0CpF6+yXr
eykAmweIfwYxcq9ko8rEYVwPf0VauNte
=0t5I
-----END PGP SIGNATURE-----
--- End Message ---