From 67a11219f7ae4a792c6ad7ab4da0b718663f249e Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 24 Sep 2007 18:10:45 +0000 Subject: [PATCH] xinit 1.0.7 --- .cvsignore | 4 +- sources | 2 +- xinit-1.0.2-client-session.patch | 2 +- xinit-1.0.2-setuid.diff | 19 ---- ...poke-ck.patch => xinit-1.0.7-poke-ck.patch | 95 +++++++++---------- xinput.sh | 50 ---------- xorg-x11-xinit.spec | 11 ++- 7 files changed, 56 insertions(+), 127 deletions(-) delete mode 100644 xinit-1.0.2-setuid.diff rename xinit-1.0.2-2-poke-ck.patch => xinit-1.0.7-poke-ck.patch (69%) delete mode 100644 xinput.sh diff --git a/.cvsignore b/.cvsignore index 8ab848c..70677d0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1 @@ -*.tar.bz2 -*.tar.gz -clog +xinit-1.0.7.tar.bz2 diff --git a/sources b/sources index 3705b8f..33e3bf6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d591fafe69b57969b0521c461073a01f xinit-1.0.2.tar.bz2 +8b882d9e2deed9d85469a3beaec566a3 xinit-1.0.7.tar.bz2 diff --git a/xinit-1.0.2-client-session.patch b/xinit-1.0.2-client-session.patch index 106b50f..89381d0 100644 --- a/xinit-1.0.2-client-session.patch +++ b/xinit-1.0.2-client-session.patch @@ -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) { diff --git a/xinit-1.0.2-setuid.diff b/xinit-1.0.2-setuid.diff deleted file mode 100644 index 277d0f5..0000000 --- a/xinit-1.0.2-setuid.diff +++ /dev/null @@ -1,19 +0,0 @@ -Index: xinit.c -=================================================================== -RCS file: /cvs/xorg/app/xinit/xinit.c,v -retrieving revision 1.4 -diff -u -r1.4 xinit.c ---- xinit.c 4 Oct 2005 01:27:34 -0000 1.4 -+++ xinit.c 19 Jun 2006 21:31:58 -0000 -@@ -692,7 +692,10 @@ - startClient(char *client[]) - { - if ((clientpid = vfork()) == 0) { -- setuid(getuid()); -+ if (setuid(getuid()) == -1) { -+ Error("cannot change uid: %s\n", strerror(errno)); -+ _exit(ERR_EXIT); -+ } - setpgrp(0, getpid()); - environ = newenviron; - #ifdef __UNIXOS2__ diff --git a/xinit-1.0.2-2-poke-ck.patch b/xinit-1.0.7-poke-ck.patch similarity index 69% rename from xinit-1.0.2-2-poke-ck.patch rename to xinit-1.0.7-poke-ck.patch index 84bb818..201d57c 100644 --- a/xinit-1.0.2-2-poke-ck.patch +++ b/xinit-1.0.7-poke-ck.patch @@ -1,46 +1,14 @@ -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 +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: $ */ -@@ -37,6 +38,13 @@ in this Software without prior written authorization from The Open Group. - #include +@@ -39,6 +40,13 @@ in this Software without prior written a #include + #include +#define USE_CONKIT +#ifdef USE_CONKIT @@ -52,7 +20,7 @@ index 818f754..de97791 100644 #ifdef X_POSIX_C_SOURCE #define _POSIX_C_SOURCE X_POSIX_C_SOURCE #include -@@ -558,6 +566,39 @@ processTimeout(int timeout, char *string) +@@ -521,6 +529,39 @@ processTimeout(int timeout, char *string return( serverpid != pidfound ); } @@ -92,7 +60,7 @@ index 818f754..de97791 100644 static int startServer(char *server[]) { -@@ -685,6 +726,12 @@ startServer(char *server[]) +@@ -631,6 +672,12 @@ startServer(char *server[]) break; } @@ -105,7 +73,7 @@ index 818f754..de97791 100644 return(serverpid); } -@@ -748,6 +795,13 @@ shutdown(void) +@@ -785,6 +832,13 @@ shutdown(void) clientpid); } @@ -119,7 +87,7 @@ index 818f754..de97791 100644 if (serverpid < 0) return; errno = 0; -@@ -784,6 +838,13 @@ shutdown(void) +@@ -821,6 +875,13 @@ shutdown(void) * make a new copy of environment that has room for DISPLAY */ @@ -133,21 +101,21 @@ index 818f754..de97791 100644 static void set_environment(void) { -@@ -795,11 +856,11 @@ set_environment(void) +@@ -832,11 +893,11 @@ set_environment(void) for (oldPtr = environ; *oldPtr; oldPtr++) ; nenvvars = (oldPtr - environ); -- newenviron = (char **) malloc ((nenvvars + 2) * sizeof(char **)); +- 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 + 2); +- program, nenvvars + 3); + program, nenvvars + NUM_EXTRA_ENV_VARS); exit (1); } -@@ -809,9 +870,17 @@ set_environment(void) +@@ -846,10 +907,19 @@ set_environment(void) newPtr = newenviron; *newPtr++ = displaybuf; @@ -157,11 +125,42 @@ index 818f754..de97791 100644 + /* 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 -+ if (strncmp (*oldPtr, "DISPLAY=", 8) != 0 && strncmp (*oldPtr, "XDG_SESSION_COOKIE=", 19) != 0) { -+#else - if (strncmp (*oldPtr, "DISPLAY=", 8) != 0) { ++ && 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} diff --git a/xinput.sh b/xinput.sh deleted file mode 100644 index b6356ef..0000000 --- a/xinput.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This -# copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the -# GNU General Public License version 2. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# X Input method setup script - -USER_XINPUTRC="$HOME/.xinputrc" -SYS_XINPUTRC="/etc/X11/xinit/xinputrc" - -# Load up the user and system locale settings -oldterm=$TERM -unset TERM -if [ -r /etc/profile.d/lang.sh ]; then - source /etc/profile.d/lang.sh -fi -[ -n "$oldterm" ] && export TERM=$oldterm - -tmplang=${LC_CTYPE:-${LANG:-"en_US.UTF-8"}} - -# unset env vars to be safe -unset XIM XIM_PROGRAM XIM_ARGS XMODIFIERS GTK_IM_MODULE QT_IM_MODULE - -if [ -r "$USER_XINPUTRC" ]; then - source "$USER_XINPUTRC" -elif [ -r "$SYS_XINPUTRC" ]; then - # FIXME: This hardcoded list has to be gone in the future. - _language_list="as bn gu hi ja kn ko ml mr ne or pa si ta te th ur vi zh" - for i in $_language_list; do - if echo $tmplang | grep -q -E "^$i"; then - source "$SYS_XINPUTRC" - break - fi - done -fi - -[ -n "$GTK_IM_MODULE" ] && export GTK_IM_MODULE -[ -n "$QT_IM_MODULE" ] && export QT_IM_MODULE - -# setup XMODIFIERS -[ -z "$XMODIFIERS" -a -n "$XIM" ] && XMODIFIERS="@im=$XIM" -[ -n "$XMODIFIERS" ] && export XMODIFIERS - -# execute XIM_PROGRAM -[ -n "$XIM_PROGRAM" ] && which "$XIM_PROGRAM" > /dev/null 2>&1 && LANG="$tmplang" "$XIM_PROGRAM" $XIM_ARGS & diff --git a/xorg-x11-xinit.spec b/xorg-x11-xinit.spec index 351c625..6b3ceaf 100644 --- a/xorg-x11-xinit.spec +++ b/xorg-x11-xinit.spec @@ -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 @@ Source14: Xresources 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 @@ X.Org X11 X Window System xinit startup scripts %prep %setup -q -n %{pkgname}-%{version} -%patch0 -p0 -b .setuid %patch1 -p1 -b .client-session %patch2 -p1 -b .poke-ck @@ -110,6 +108,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/xinit.1* %changelog +* Mon Sep 24 2007 Adam Jackson 1.0.7-1 +- xinit 1.0.7 + * Tue Aug 21 2007 Adam Jackson - 1.0.2-27 - Rebuild for build id