Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 151476 Details for
Bug 233183
xinit needs to poke ConsoleKit
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
updated xinit patch
xinit-1.0.2-2-poke-ck.patch (text/plain), 3.93 KB, created by
David Zeuthen
on 2007-04-02 21:17:37 UTC
(
hide
)
Description:
updated xinit patch
Filename:
MIME Type:
Creator:
David Zeuthen
Created:
2007-04-02 21:17:37 UTC
Size:
3.93 KB
patch
obsolete
>diff --git a/Makefile.am b/Makefile.am >diff --git a/configure.ac b/configure.ac >index 55648bc..07e40cd 100644 >--- a/configure.ac >+++ b/configure.ac >@@ -91,7 +91,7 @@ AC_ARG_WITH(xinit, > [XINIT="$DEFAULT_XINIT"]) > > # Checks for pkg-config packages >-PKG_CHECK_MODULES(XINIT, x11) >+PKG_CHECK_MODULES(XINIT, x11 ck-connector) > > case $host_os in > *bsd*) >diff --git a/startx.cpp b/startx.cpp >index eba83b8..f091fa5 100644 >--- a/startx.cpp >+++ b/startx.cpp >@@ -217,6 +217,12 @@ done > > #endif > >+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 818f754..de97791 100644 >--- a/xinit.c >+++ b/xinit.c >@@ -1,3 +1,4 @@ >+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- > /* $Xorg: xinit.c,v 1.5 2001/02/09 02:05:49 xorgcvs Exp $ */ > /* $XdotOrg: $ */ > >@@ -37,6 +38,13 @@ in this Software without prior written authorization from The Open Group. > #include <stdio.h> > #include <ctype.h> > >+#define USE_CONKIT >+#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> >@@ -558,6 +566,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[]) > { >@@ -685,6 +726,12 @@ startServer(char *server[]) > break; > } > >+#ifdef USE_CONKIT >+ if (serverpid != -1 ) { >+ register_new_session_with_console_kit (); >+ } >+#endif /* USE_CONKIT */ >+ > return(serverpid); > } > >@@ -748,6 +795,13 @@ shutdown(void) > clientpid); > } > >+#ifdef USE_CONKIT >+ if (ckc != NULL) { >+ ck_connector_unref (ckc); >+ ckc = NULL; >+ } >+#endif >+ > if (serverpid < 0) > return; > errno = 0; >@@ -784,6 +838,13 @@ shutdown(void) > * make a new copy of environment that has room for DISPLAY > */ > >+ >+#ifdef USE_CONKIT >+#define NUM_EXTRA_ENV_VARS 3 >+#else >+#define NUM_EXTRA_ENV_VARS 2 >+#endif >+ > static void > set_environment(void) > { >@@ -795,11 +856,11 @@ set_environment(void) > for (oldPtr = environ; *oldPtr; oldPtr++) ; > > nenvvars = (oldPtr - environ); >- newenviron = (char **) malloc ((nenvvars + 2) * 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 + 2); >+ program, nenvvars + NUM_EXTRA_ENV_VARS); > exit (1); > } > >@@ -809,9 +870,17 @@ 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++) { >+#ifdef USE_CONKIT >+ if (strncmp (*oldPtr, "DISPLAY=", 8) != 0 && strncmp (*oldPtr, "XDG_SESSION_COOKIE=", 19) != 0) { >+#else > if (strncmp (*oldPtr, "DISPLAY=", 8) != 0) { >+#endif > *newPtr++ = *oldPtr; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233183
: 151476 |
151478
|
151479
|
151481