rpms/xorg-x11-xinit/devel xinit-1.0.7-poke-ck.patch, NONE, 1.1 .cvsignore, 1.10, 1.11 sources, 1.7, 1.8 xinit-1.0.2-client-session.patch, 1.1, 1.2 xorg-x11-xinit.spec, 1.50, 1.51 xinit-1.0.2-2-poke-ck.patch, 1.1, NONE xinit-1.0.2-setuid.diff, 1.1, NONE xinput.sh, 1.4, NONE

Adam Jackson (ajax) fedora-extras-commits at redhat.com
Mon Sep 24 18:11:19 UTC 2007


Author: ajax

Update of /cvs/pkgs/rpms/xorg-x11-xinit/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24738/devel

Modified Files:
	.cvsignore sources xinit-1.0.2-client-session.patch 
	xorg-x11-xinit.spec 
Added Files:
	xinit-1.0.7-poke-ck.patch 
Removed Files:
	xinit-1.0.2-2-poke-ck.patch xinit-1.0.2-setuid.diff xinput.sh 
Log Message:
xinit 1.0.7


xinit-1.0.7-poke-ck.patch:

--- NEW FILE xinit-1.0.7-poke-ck.patch ---
diff -up xinit-1.0.7/xinit.c.poke-ck xinit-1.0.7/xinit.c
--- xinit-1.0.7/xinit.c.poke-ck	2007-09-24 13:48:04.000000000 -0400
+++ xinit-1.0.7/xinit.c	2007-09-24 13:53:55.000000000 -0400
@@ -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: $ */
 
@@ -39,6 +40,13 @@ in this Software without prior written a
 #include <ctype.h>
 #include <stdint.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>
@@ -521,6 +529,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 +672,12 @@ startServer(char *server[])
 		break;
 	}
 
+#ifdef USE_CONKIT
+	if (serverpid != -1 ) {
+		register_new_session_with_console_kit ();
+	}
+#endif /* USE_CONKIT */
+
 	return(serverpid);
 }
 
@@ -785,6 +832,13 @@ shutdown(void)
 				clientpid);
 	}
 
+#ifdef USE_CONKIT
+	if (ckc != NULL) {
+		ck_connector_unref (ckc);
+		ckc = NULL;
+	}
+#endif
+
 	if (serverpid < 0)
 		return;
 	errno = 0;
@@ -821,6 +875,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)
 {
@@ -832,11 +893,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);
     }
 
@@ -846,10 +907,19 @@ 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;
 	}
     }
diff -up xinit-1.0.7/configure.ac.poke-ck xinit-1.0.7/configure.ac
--- xinit-1.0.7/configure.ac.poke-ck	2007-09-17 06:46:38.000000000 -0400
+++ xinit-1.0.7/configure.ac	2007-09-24 13:48:04.000000000 -0400
@@ -92,7 +92,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 -up xinit-1.0.7/startx.cpp.poke-ck xinit-1.0.7/startx.cpp
--- xinit-1.0.7/startx.cpp.poke-ck	2007-09-16 17:24:48.000000000 -0400
+++ xinit-1.0.7/startx.cpp	2007-09-24 13:48:04.000000000 -0400
@@ -223,6 +223,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}


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-xinit/devel/.cvsignore,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- .cvsignore	5 Jul 2006 06:46:08 -0000	1.10
+++ .cvsignore	24 Sep 2007 18:10:45 -0000	1.11
@@ -1,3 +1 @@
-*.tar.bz2
-*.tar.gz
-clog
+xinit-1.0.7.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-xinit/devel/sources,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sources	27 Apr 2006 22:49:30 -0000	1.7
+++ sources	24 Sep 2007 18:10:45 -0000	1.8
@@ -1 +1 @@
-d591fafe69b57969b0521c461073a01f  xinit-1.0.2.tar.bz2
+8b882d9e2deed9d85469a3beaec566a3  xinit-1.0.7.tar.bz2

xinit-1.0.2-client-session.patch:

Index: xinit-1.0.2-client-session.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-xinit/devel/xinit-1.0.2-client-session.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xinit-1.0.2-client-session.patch	10 Nov 2006 15:31:06 -0000	1.1
+++ xinit-1.0.2-client-session.patch	24 Sep 2007 18:10:45 -0000	1.2
@@ -9,7 +9,7 @@
  			Error("cannot change uid: %s\n", strerror(errno));
  			_exit(ERR_EXIT);
  		}
--		setpgrp(0, getpid());
+-		setpgid(0, getpid());
 +		fd = open ("/dev/null", O_RDONLY);
 +
 +		if (fd < 0) {


Index: xorg-x11-xinit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-xinit/devel/xorg-x11-xinit.spec,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- xorg-x11-xinit.spec	21 Aug 2007 19:30:34 -0000	1.50
+++ xorg-x11-xinit.spec	24 Sep 2007 18:10:45 -0000	1.51
@@ -2,8 +2,8 @@
 
 Summary:   X.Org X11 X Window System xinit startup scripts
 Name:      xorg-x11-%{pkgname}
-Version:   1.0.2
-Release:   27%{?dist}
+Version:   1.0.7
+Release:   1%{?dist}
 License:   MIT/X11
 Group:     User Interface/X
 URL:       http://www.x.org
@@ -20,9 +20,8 @@
 Source16: Xsession
 Source17: localuser.sh
 
-Patch0: ftp://ftp.freedesktop.org/pub/xorg/X11R7.1/patches/xinit-1.0.2-setuid.diff
 Patch1: xinit-1.0.2-client-session.patch
-Patch2: xinit-1.0.2-2-poke-ck.patch
+Patch2: xinit-1.0.7-poke-ck.patch
 
 BuildRequires: pkgconfig
 BuildRequires: libX11-devel
@@ -54,7 +53,6 @@
 
 %prep
 %setup -q -n %{pkgname}-%{version}
-%patch0 -p0 -b .setuid
 %patch1 -p1 -b .client-session
 %patch2 -p1 -b .poke-ck
 
@@ -110,6 +108,9 @@
 %{_mandir}/man1/xinit.1*
 
 %changelog
+* Mon Sep 24 2007 Adam Jackson <ajax at redhat.com> 1.0.7-1
+- xinit 1.0.7
+
 * Tue Aug 21 2007 Adam Jackson <ajax at redhat.com> - 1.0.2-27
 - Rebuild for build id
 


--- xinit-1.0.2-2-poke-ck.patch DELETED ---


--- xinit-1.0.2-setuid.diff DELETED ---


--- xinput.sh DELETED ---




More information about the fedora-extras-commits mailing list